TwitteR setup_twitter_oauth() failing

前端 未结 11 564
忘掉有多难
忘掉有多难 2020-12-20 11:45

I was following the vignette for the package, updated and loaded all necessary packages, seemed like it would be a pretty straight-forward process to authenticate. Instead,

11条回答
  •  别那么骄傲
    2020-12-20 12:36

    I tried all the suggestions here but surprisingly none worked for me. Somebody could be going through the same situation as I did so I answer with what worked for me- it seems that the problem was with direct authentication, so I followed the following steps(this requires one to have the openssl package) installed and loaded along with the twitteR package;

    Ensure you have created your twitter API and have the consumerkey and consumerSecret codes, and preferably remain logged into twitter with your default web browser

    packages <- c("twitteR", "openssl")
    ### checking if packages are already installed and installing if not
    for(i in packages){
        if(!(i %in% installed.packages()[, "Package"])){
            install.packages(i)
        }
    library(i, character.only = TRUE) ## load packages
    }
    
    setup_twitter_oauth(consumer_key, consumer_secret) ## do not input the access_token and access_secret
    

    This is going to open up your default browser with the successful authentication message. You can close the browser now and continue exploring tweets with R.

提交回复
热议问题