Skip to content

Instantly share code, notes, and snippets.

@up1
Last active August 29, 2015 14:08
Show Gist options
  • Save up1/2be50be420babab55b80 to your computer and use it in GitHub Desktop.
Save up1/2be50be420babab55b80 to your computer and use it in GitHub Desktop.
R Demo :: Twitter
[1] "coderwall-protips-bot"
[2] "NoSQLDigest"
[3] "Twitter for Websites"
[4] "mikutter"
[5] "TweetDeck"
[6] "Tweetbot for iΟS"
[7] "Mobile Web (M5)"
[8] "Hootsuite"
[9] "TweetDeck"
[10] "Twitter Web Client"
[11] "Twitter for Android"
[12] "Twitter for iPhone"
[13] "Twitter Web Client"
[14] "Twitter Web Client"
[15] "LinkedIn"
[16] "Twitter Web Client"
[17] "TweetDeck"
[18] "RubyGems.org"
[19] "Twitter Web Client"
[20] "Twitter for Mac"
[21] "Wikimedia Morebots Wikitech"
[22] "Twitter Web Client"
[23] "Sylfeed"
[24] "Twitter for iPhone"
[25] "Twitter for Android"
[26] "Twitter for Windows"
[27] "twicca"
[28] "Twitter for Mac"
[29] "TweetDeck"
[30] "Twitter for Mac"
[31] "Twitter Web Client"
[32] "Twitter for Android"
[33] "Hatena"
[34] "Twitter Web Client"
[35] "Twitter Web Client"
[36] "Twitter Web Client"
[37] "TweetDeck"
[38] "Polly"
[39] "Twitter Web Client"
[40] "TweetDeck"
[41] "Twitter for iPhone"
[42] "Tweetbot for iΟS"
[43] "Talon (Classic)"
[44] "Twitter for Android"
[45] "Hootsuite"
[46] "Twitter for iPhone"
[47] "Twitter for Websites"
[48] "Twitter for Android"
[49] "TweetDeck"
[50] "TweetDeck"
[51] "Twitter Web Client"
[52] "Twitter Web Client"
[53] "Wikimedia Morebots Wikitech"
[54] "Wikimedia Morebots Wikitech"
[55] "Twitter Web Client"
[56] "dlvr.it"
[57] "Wikimedia Morebots Wikitech"
[58] "Wikimedia Morebots Wikitech"
[59] "Twitter for Android"
[60] "Twitter for iPhone"
[61] "PyPI Recent Updates Bot"
[62] "Hootsuite"
[63] "Twitter for Websites"
[64] "Twitter Web Client"
[65] "Twitter for iPhone"
[66] "Wikimedia Morebots Wikitech"
[67] "Twitter for iPhone"
[68] "Twitter Web Client"
[69] "Twitter for Android"
[70] "Twitter Web Client"
[71] "TweetDeck"
[72] "Twitter for Android"
[73] "TweetDeck"
[74] "earthquake.gem"
[75] "TweetDeck"
[76] "HubSpot"
[77] "Twitter for iPhone"
[78] "Twitter Web Client"
[79] "Twitter for Android"
[80] "Twitter for Android"
[81] "Twitter for iPhone"
[82] "upmeetup"
[83] "Twitter for Android"
[84] "Twitter for Android"
[85] "Twitter Web Client"
[86] "Twitter for Mac"
[87] "Twitter for Android"
[88] "Twitter Web Client"
[89] "TweetDeck"
[90] "Wikimedia Morebots Wikitech"
[91] "Twitter Web Client"
[92] "Twitter Web Client"
[93] "Twitter Web Client"
[94] "Twitter Web Client"
[95] "TweetDeck"
[96] "Twitter for iPhone"
[97] "Twitter Web Client"
[98] "TweetDeck"
[99] "TweetDeck"
[100] "Twitter for Android"
install.packages(c("devtools", "rjson", "bit64", "httr"))
library(devtools)
install_github("twitteR", username="geoffjentry")
library(twitteR)
api_key <- "your api key"
api_secret <- "your api secret"
access_token <- "your access token"
access_token_secret <- "your access token secret"
setup_twitter_oauth(api_key,api_secret,access_token,access_token_secret)
tweets = searchTwitter("elasticsearch", n=100)
devices <- sapply(tweets, function(x) x$getStatusSource())
devices <- gsub("<[a|A][^>]*>|</[a|A]>", "", devices)
pie(table(devices))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment