[R] searchTwitter

Ragia Ibrahim ragia11 at hotmail.com
Sat Apr 11 18:50:36 CEST 2015


Dear group 
I used the following code to download some tweets (1500)
library(twitteR)
library(ROAuth)
library(plyr)
library(stringr)
library(ggplot2)

## Windows users need to get this file
download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem")

requestURL <"https://api.twitter.com/oauth/request_token"
   accessURL = "https://api.twitter.com/oauth/access_token"
authURL = "https://api.twitter.com/oauth/authorize"
consumerKey = "secret"
consumerSecret = "secret"
Cred <- oauthfactory$new(consumerkey="">
                            consumerSecret=consumerSecret,
                         requestURL=requestURL,
                         accessURL=accessURL,
                         authURL=authURL)
Cred$handshake(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl") )

registerTwitterOAuth(Cred)
save(Cred, file="twitter authentication.Rdata")

###########################################################

# Chunk - 2 - Twitter Scrape  
############################################################

searchTwitter(  "alhazm", n=1500   , cainfo="cacert.pem" ) 

But I got the following error message

In doRppAPICall("search/tweets", n, params = params, retryOnRateLimit = retryOnRateLimit,  :
  500 tweets were requested but the API can only return 28

why ? and how I can Increase number of retreived tweets, many thanks


Ragia

 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list