Skip to content
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

Error in athl_fun #99

Closed
pepecebo opened this issue Sep 27, 2023 · 8 comments
Closed

Error in athl_fun #99

pepecebo opened this issue Sep 27, 2023 · 8 comments
Assignees
Labels

Comments

@pepecebo
Copy link

Hi Marcus,
I am not an expert, so I apologize if my question is too simple or not clear. When I try to get data from an athlete I get an error:

athl_fun(2837007, trace = TRUE)
2837007 1 of 1
Error : SyntaxError: Unexpected end of input
$2837007
[1] NA

athl_fun(2837007, trace = FALSE)
Error : SyntaxError: Unexpected end of input
$2837007
[1] NA

The same happens with other athlete IDs.
Thanks

@fawda123
Copy link
Owner

fawda123 commented Oct 1, 2023

@pepecebo thanks for pointing this out. It looks like Strava has changed their website backend. The notoken functions will need to be updated and that may take some time. I suggest you try out the token functions instead (https://github.com/fawda123/rStrava#api-functions-token).

@fawda123
Copy link
Owner

@pepecebo this is fixed now, although you can no longer retrieve monthly summary data for the athlete, only the current month. Trophies and followers have also been added.

@pepecebo
Copy link
Author

pepecebo commented Oct 20, 2023

Hi @fawda123, I am sorry but I still get the same error.

get athlete data

athl_fun(2837007, trace = TRUE)
2837007 1 of 1
Error : SyntaxError: Unexpected end of input
$2837007
[1] NA

And using the token option I also get an error when trying to get my info:

stoken <- httr::config(token = strava_oauth('xxxx' , 'xxxx', 'xxxxxxxxxxx', app_scope="activity:read_all"))
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
myinfo <- get_athlete(stoken, id = '115455')
Error in get_basic(url_athlete(id), stoken) : Forbidden (HTTP 403).

@fawda123
Copy link
Owner

@pepecebo you'll need to install the development version to get the changes.

install.packages('rStrava', repos = c('https://fawda123.r-universe.dev', 'https://cloud.r-project.org'))

For the token option, looks like you're using your athlete ID for the client ID. They're different and you should have received the latter when you created the API on the Strava website.

Also, you should not share your app token information publicy. I edited your comment to remove the info.

@pepecebo
Copy link
Author

@fawda123 It works now, Markus, once installed the developer's version. It also works token option. Thanks!

@pepecebo
Copy link
Author

@fawda123 what I am not sure is if with the token option I can get data from other athletes, or only my own data. Also, can I get activity data since the user started to use Strava? I don't need all the details, but at least basic activity along time. Thanks!

@fawda123
Copy link
Owner

@pepecebo unfortunately you can only retrieve your data with the token functions. This is a limitation of the Strava API that is beyond my control. You can get limited data for other users with the notoken functions, but you need to know their athlete id.

And again, you can retrieve your entire Strava activity record with the token functions, but not others.

@pepecebo
Copy link
Author

pepecebo commented Oct 21, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants