Skip to content

searchTwitter

2 messages · Ragia Ibrahim

#
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
#
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