title: Unauthorized access to twitteR API after registration
body: <p>I have been following the script and instruction from several blogs <a href="http://davetang.org/muse/2013/04/06/using-the-r_twitter-package/" rel="nofollow noreferrer">Twitter Authentication with R</a> and <a href="http://stathack.wordpress.com/2013/06/13/getting-started-with-twitter-in-r/" rel="nofollow noreferrer">Using the R twitteR package</a> to access the twitter API.</p>
  
  <pre><code>library(twitteR)
  library(ROAuth)
  
  reqURL &lt;- "https://api.twitter.com/oauth/request_token"
  accessURL &lt;- "http://api.twitter.com/oauth/access_token"
  authURL &lt;- "http://api.twitter.com/oauth/authorize"
  consumerKey &lt;- "-----------------"
  consumerSecret &lt;- "-----------------------------"
  twitCred &lt;- OAuthFactory$new(consumerKey=consumerKey,
                               consumerSecret=consumerSecret,
                               requestURL=reqURL,
                               accessURL=accessURL,
                               authURL=authURL)
  download.file(url="http://curl.haxx.se/ca/cacert.pem",
                destfile="cacert.pem")
  twitCred$handshake(cainfo = system.file("CurlSSL", "cacert.pem",
                     package = "RCurl"))
  registerTwitterOAuth(twitCred)
  testSearch = searchTwitter("#food", n = 10, cainfo="cacert.pem")
  </code></pre>
  
  <p>I have no problem registering, everything went fine till I start using the searchTwitter() function where it throws  me the following error.</p>
  
  <pre><code>testSearch = searchTwitter("#food", n = 10, cainfo="cacert.pem")
  [1] "Unauthorized"
  Error in twInterfaceObj$doAPICall(cmd, params, "GET", ...) : 
    Error: Unauthorized
  </code></pre>
  
  <p>I have tried to solve the problem by looking at <a href="https://stackoverflow.com/questions/9916283/twitter-roauth-and-windows-register-ok-but-certificate-verify-failed">TwitteR, ROAuth and Windows: register OK, but certificate verify failed</a> and <a href="http://geoffjentry.hexdump.org/twitteR.pdf" rel="nofollow noreferrer">Twitter client for  R</a> and a similar problem at <a href="https://stackoverflow.com/questions/15713073/twitter-help-unable-to-authorize-even-with-registering">twitteR help unable to authorize even with registering</a></p>
  
  <p>However, I was unsuccessful to resolve this problem. Any help is extremely welcome. Thanks in advance.</p>
  
  <pre><code>R version 3.0.2 (2013-09-25)
  Platform: x86_64-pc-linux-gnu (64-bit)
  
  locale:
    [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
    [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_AU.UTF-8    
    [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_AU.UTF-8   
    [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
    [9] LC_ADDRESS=C               LC_TELEPHONE=C            
    [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] twitteR_1.1.7  rjson_0.2.13   ROAuth_0.9.3   digest_0.6.3   RCurl_1.95-4.1
  [6] bitops_1.0-6  
  
  loaded via a namespace (and not attached):
  [1] compiler_3.0.2 tools_3.0.2   
  </code></pre>