Tufekci (2014) wrote that “Twitter has become to social media scholars what the fruit fly is to biologists—a model organism.” But, let’s not forget that there are so many web platforms out there. Arguably, Facebook provides far richer insights than Twitter given its comparatively larger user base and higher penetration rate around the world. Unfortunately, Facebook has shutted down much of its API, making our previous tutorials on Facebook-based data mining obsolete.
This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics.
Collecting user information? That sounds creepy!
Not at all. We will conduct the data collection in strict compliance with Twitter’s developer terms. In fact, just like the rate limits imposed on collecting tweets, Twitter makes it very limited as to what kind of user profile data are available through its API.
This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics.
What is the rate limit for collecting timeline data
According to this Twitter API document, you can get up to 3,200 of a user’s most recent tweets.
Scrapping tweets from someone’s timeline is as easy as running the code below. We will get the recent 200 tweets from Elizabeth Warren, a Senator of Massachusetts (@SenWarren).
This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics.
Collect tweets by keywords/hashtags What Twitter Data are Available?
From the previous (post)[https://curiositybits.cc/post/r_analytics2/], you have learned that in order to collect data from Twitter API, you must obtain permission, namely. You probably have also noticed that it is not possible to collect as many tweets as you would like to because Twitter imposes rate limit on each API call.
This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics.
What is Twitter API? API (Application Programming Interface) is a marketplace of data. Twitter makes some of its data publically available and free of access. To obtain the data, you must register a client app and complete the authentification process. Here you will learn how to connect to the Twitter API with pre-obtained credentials: consumer key, consumer secret, access token, and access secret.
This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics.
What is a library/package? Think of R as an operating system (e.g., iOS, Windows) and a library/package as an app running on the system. Each library is designed to accomplish specific tasks. For example, the library ggplot2–which is a library we will use throughout the semester–is for visualizing data, and the library rtweet is used for collecting Twitter data.
COMM497DB Fall 2019 Access the interactive tutorial Download course syllabus
Week1: Slide: Introducing Digital Behavioral data
Week1: Slide: An Introduction to R
Week1: Practice code
Week2: Slide: Application Programming Interfaces (API)
Week2: Slide: Collect Twitter Data
Week2: Practice code for API
Week2: Practice code for Collecting Twitter Data part 1
Week3: Slide: Twitter Data Explained
Week3: Practice code for Collecting Twitter Data part 2