AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Download tweetdeck ipad1/22/2024 ![]() ![]() ![]() This is a restriction of the Twitter Search API, and it often means you won't actually get the number of tweets you specified.Ĭlinton_tweets <- userTimeline(user = n = 200, includeRts = FALSE, retryOnRateLimit = 2000) Unfortunately you can't use the API to request tweets older than a week or two at most. We will use 200 in this example, but the maximum is 3200. # n specifies how many tweets you want from the user. To get warmed up, let’s see what the two US presidential nominees have been talking about.ĭownloading tweets from a single user is very easy, just use the userTimeline() Setup_twitter_oauth(API_key, API_secret, access_token, access_secret) # Type in your app details from Twitter here: To get a feel for the commands we will pass through the code, I urge you to have a look at Twitter’s API documentation. If you don’t have these packages, then use install.packages("NameOfPackage")īefore running the code above. I am going to use a combination of the excellent twitteR package and httr for pulling tweets, I’ll leave the details of how to get OAuth and dev-app running here, since it explains it better than I would have been able to.īy the end of this guide you will be able to download tweets from specific users and from lists, plotting commonly used words and examining tweeting activity using meta-data. This guide requires that you have a Twitter account, R(studio), and have setup a twitter-dev account with OAuth. Lastly, I wanted to show how analysing the Twitter meta-data in addition to the tweets themselves can lead to better behavioural insights. To this end, I will provide some simple functions built on top of other packages that enable you to download tweets from pre-specified groups of people instead of just whoever tweets on a certain topic. This approach also means that the scripts we want to write have to be more reusable in nature in order to retrieve, load, and analyze several different groups repeatedly. Meta-data can be a rich source of information for that. As researchers however, we are often also interested in comparing and contrasting data between groups. First, while there are many other guides on R-Bloggers that show similar things, they tend to focus more on setting up your Twitter account and using wordclouds. I wanted to write this guide for several reasons. For my first blog post on R, I want to show how to use R to mine Twitter-data. ![]()
0 Comments
Read More
Leave a Reply. |