Here are some customized functions for the course I teach in the Spring Semester 2017 at the University of Zurich. For convenience I crated a small package. Will update continiously.
if(!require("devtools")) install.packages("devtools")
library(devtools)
install_github("adrauc/socialsemR")
library(socialsemR)
Functions help for content analysis. Open automatically tweets, users, and posts on facebook:
# for all functions: enter opens the next case, if you type quit and hit enter, it quits. # to open a facebook user: input is a vector with user ids (strings): open_user_fbaccount(comments_df[ ,"from_id"]) # to open a specific tweet: input is a df from the streamAPI: open_tweet(tweets_df) # to open a specific tweet (REST API): input is a df from the REST API: open_tweet_rest(tweets_df) # to open a specific Twitter user: input is a df from the streamAPI: open_tweet_user(tweets_df) # to open a specific facebook post: input is a vector with post ids (strings) and the username from the url open_facebook_post(facebook_posts_voice[ ,"id"], "TheVoiceOfGermany") # to open a specific facebook comment: input is a vector with comment ids # and the username from the url open_facebook_comment(comments_df$id, "TheVoiceOfGermany") # to open a specific instagram picture: input is a data frame with the columns "id", "comments", and "likes": open_pictures_insta(ensoie_df)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.