New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with TokenLinkedIn function?? #173

Closed
harishnreddy opened this Issue Dec 5, 2014 · 6 comments

Comments

Projects
None yet
3 participants
@harishnreddy

harishnreddy commented Dec 5, 2014

Made progress on the issue once I upgraded R and got the latest R6 version, but somehow stuck on the TokenLinkedIn$new function. Getting an invalid argument type back. Have to imagine that there is an issue in my code / configuration, but not able to find it / not quite sure where to look.

> token <- TokenLinkedIn$new(endpoint = oauth_endpoints("linkedin"), app = myapp)
Use a local file to cache OAuth access credentials between R sessions?
1: Yes
2: No

Selection: 2
Error in !use_oob : invalid argument type
> traceback()
4: init_oauth2.0(self$endpoint, self$app, scope = self$params$scope, 
       type = self$params$type, use_oob = self$params$use_oob)
3: self$init_credentials()
2: public_bind_env$initialize(...)
1: TokenLinkedIn$new(endpoint = oauth_endpoints("linkedin"), app = myapp)
> devtools::session_info()
Session info-------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.1.2 (2014-10-31)
 system   x86_64, darwin10.8.0        
 ui       RStudio (0.98.490)          
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/New_York            

Packages-----------------------------------------------------------------------------------
 package    * version    date       source                      
 bitops       1.0.6      2013-08-17 CRAN (R 3.1.0)              
 devtools     1.6.1      2014-10-07 CRAN (R 3.1.1)              
 httr       * 0.5.0.9000 2014-12-05 Github (hadley/httr@41c2a54)
 R6           2.0.1      2014-10-29 CRAN (R 3.1.2)              
 RCurl        1.95.4.4   2014-11-29 CRAN (R 3.1.2)              
 rstudioapi   0.1        2014-03-27 CRAN (R 3.1.0)              
 stringr      0.6.2      2012-12-06 CRAN (R 3.1.0)              
> 
@harishnreddy

This comment has been minimized.

harishnreddy commented Dec 6, 2014

I was not able to figure out how to solve this problem to generate the credential file on my machine. But, someone else created a credential file and I was able to use the code to run the query.

Not sure if you know of a way to provide some guidance on why it is happening on my machine??

@hadley

This comment has been minimized.

Member

hadley commented Dec 6, 2014

I'd suggest running update.packages() to make sure you have the latest version of everything.

@zippeurfou

This comment has been minimized.

zippeurfou commented Dec 12, 2014

Just tried and had the same error as @harishnreddy.
Got around it by using the resolution from issue #113

TokenLinkedIn <- setRefClass("TokenLinkedIn", contains = "Token2.0",
    methods = list(
        sign = function(method, url) {
            url <- parse_url(url)
            url$query$oauth2_access_token <- credentials$access_token
            list(url = build_url(url), config = config())
        },
        cache = function() {
            .self ## No-op
        },
        load_from_cache = function() {
            FALSE
        }
    )
)
token <- new_token(TokenLinkedIn, oauth_endpoints("linkedin"), myapp, cache=FALSE)
@harishnreddy

This comment has been minimized.

harishnreddy commented Dec 12, 2014

Thanks - I had someone else create a key for me and then everything worked as designed.

I need to go back and get the key creation process working, but for the moment, need to move forward with the data analysis and hence am a bit reluctant to retry creating the key - but I do plan to get the key generation process working.

Thanks for your comment.

@hadley

This comment has been minimized.

Member

hadley commented Dec 31, 2014

@zippeurfou if that worked for you, you don't have the latest version of httr, because it no longer uses ref classes.

@hadley hadley closed this in 132e29f Dec 31, 2014

@hadley

This comment has been minimized.

Member

hadley commented Dec 31, 2014

Finally managed to reproduce the problem - should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment