Created
August 30, 2010 05:21
-
-
Save astatham/557049 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/Rscript | |
library(twitteR) | |
library(imguR) | |
sess <- initSession("clark_lab_linux", "password") | |
rstats <- searchTwitter("#rstats", sess, n=1000) | |
#filter out junk | |
rstats <- rstats[sapply(sapply(rstats, screenName), length)>0] | |
#make graph | |
posters <- sort(table(sapply(rstats, screenName)), decreasing=TRUE) | |
imguR() | |
par(mai=c(1.5, 0.82, 0.82, 0.4)) | |
barplot(posters[1:20], border=NA, las=2, main=paste("Top 20 #rstats tweeters since", created(rstats[[length(rstats)]])), ylab="Number of twats") | |
abline(h=0) | |
graph_url <- dev.off() | |
tweet(paste("Top 20 rstats tweeters automated graph!", graph_url), sess) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment