library(RCurl) library(rjson) hashtags <- c("%23cagov", "%23cagovdebate", "jerry+brown", "meg+whitman", "brown+whitman", "%23cadebate") for (i in 1:length(hashtags)) { for (j in 1:10) { text <- getURL(paste(c("http://search.twitter.com/search.json?q=", hashtags[i],"&rpp=100&since=2010-10-13&until=2010-10-13&page=", j),collapse='')) entry <- fromJSON(text) print(entry) #DO SOMETHING... here we just print } } #or for (i in 1:length(hashtags)) { for (j in 1:10) { entry <- fromJSON(file=paste(c("http://search.twitter.com/search.json?q=", hashtags[i],"&rpp=100&since=2010-10-13&until=2010-10-13&page=", j),collapse='')) print(entry) #DO SOMETHING... here we just print } }