Closed mtengelin closed 5 years ago
It looks like Strava has finally changed the layout of the athlete pages - I will have to rewrite athl_fun()
or just remove it completely. I'm not even sure if the raw data would be available from a simple HTML scrape.
That would really be a shame not to have it as part of the package, I am actively using it for a few dashboards and find it really useful. Hope it can be fixed.
From: Marcus W Beck notifications@github.com Sent: Sunday, March 31, 2019 4:53 PM To: fawda123/rStrava Cc: Martin Tengelin; Author Subject: Re: [fawda123/rStrava] Unable to scrape athlete data with athl_fun() (#53)
It looks like Strava has finally changed the layout of the athlete pages - I will have to rewrite athl_fun() or just remove it completely. I'm not even sure if the raw data would be available from a simple HTML scrape.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/fawda123/rStrava/issues/53#issuecomment-478348805, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMvmKOxcwqiE2N_XZnjNR7uLwfM4FKfMks5vcMvrgaJpZM4b5O-R.
I looked into this a bit more and I think I found a solution. The new format of the public web pages doesn't have all of the info that was in the previous, but you can still get quite a bit. I will have to work this in to a new function.
library(rvest)
library(V8)
url_in <- 'https://www.strava.com/athletes/2837007'
athl <- url_in %>%
read_html %>%
html_nodes("[data-react-class]") %>%
xml_attr('data-react-props') %>%
v8()$get(.)
athl
# $`athlete`
# $`athlete`$`name`
# [1] "Marcus Beck"
#
# $`athlete`$location
# [1] "Irvine, California"
#
# $`athlete`$avatarUrl
# [1] "https://dgalywyr863hv.cloudfront.net/pictures/athletes/2837007/900880/4/large.jpg"
#
# $`athlete`$primarySport
# [1] "athlete-cyclist"
#
# $`athlete`$followersCount
# [1] 74
#
# $`athlete`$followingCount
# [1] 74
#
# $`athlete`$followUrl
# [1] "https://www.strava.com/register?content=2837007&cta=follow&element=button&follow_athlete_after_login=true&follow_athlete_after_registration=true&follow_athlete_id=2837007&source=route"
#
#
# $trophies
# list()
#
# $`recentActivities`
# id name type description startDateLocal distance elevation movingTime
# 1 2259675934 Morning Ride ride NA Yesterday 10.6 mi 51 ft 40:28
# 2 2258696770 Afternoon Ride ride NA Yesterday 10.7 mi 117 ft 43:23
# 3 2257254459 Morning Ride ride NA March 31, 2019 10.6 mi 51 ft 40:24
# images
# 1 map, TRUE, Morning Ride, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/600x280.jpg?request=ZmFsc2UgMjI1OTY3NTkzNA==&signature=6350cfdf25942ac9b919ffe297e93a26d2fea2c401fd80f13b5f2b7cc66d8526&activityVersion=e820073, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/280x280.jpg?request=ZmFsc2UgMjI1OTY3NTkzNA==&signature=6350cfdf25942ac9b919ffe297e93a26d2fea2c401fd80f13b5f2b7cc66d8526&activityVersion=e820073
# 2 map, TRUE, Afternoon Ride, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/600x280.jpg?request=ZmFsc2UgMjI1ODY5Njc3MA==&signature=6471ed645a00ecca17390234fc4440aae0f73fbbae7cfc8bebeb3a99b76f15bc&activityVersion=5c76240, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/280x280.jpg?request=ZmFsc2UgMjI1ODY5Njc3MA==&signature=6471ed645a00ecca17390234fc4440aae0f73fbbae7cfc8bebeb3a99b76f15bc&activityVersion=5c76240
# 3 map, TRUE, Morning Ride, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/600x280.jpg?request=ZmFsc2UgMjI1NzI1NDQ1OQ==&signature=77dd1bb914ac16d187435f630f963d1d97d4bbeec5fa590945751e6caddc6bbc&activityVersion=7200e12, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/280x280.jpg?request=ZmFsc2UgMjI1NzI1NDQ1OQ==&signature=77dd1bb914ac16d187435f630f963d1d97d4bbeec5fa590945751e6caddc6bbc&activityVersion=7200e12
# isManual hasGps
# 1 FALSE TRUE
# 2 FALSE TRUE
# 3 FALSE TRUE
#
# $stats
# $stats$`monthlyDistance`
# [1] "32.0 mi"
#
# $stats$monthlyTime
# [1] "2:04:15"
#
# $stats$chartData
# month miles hours elev_gain
# 1 2018-10-01 329.08191 23 1521
# 2 2018-11-01 248.76223 18 955
# 3 2018-12-01 161.58634 14 964
# 4 2019-01-01 391.10905 28 1110
# 5 2019-02-01 247.53005 18 679
# 6 2019-03-01 343.69594 24 1039
# 7 2019-04-01 32.08015 2 66
#
#
# $achievements
# description showTrophy spriteName
# 1 2nd best estimated 10k effort TRUE icon-at-pr-2
# 2 PR on Race the Northbound Train TRUE icon-at-pr-1
# 3 PR on Main St. Mortal Kombat TRUE icon-at-pr-1
# 4 PR on NB Warner to ICD TRUE icon-at-pr-1
# 5 PR on Harvard - Warner to Walnut TRUE icon-at-pr-1
# timeago
# 1 <time class="timeago" datetime="2019-03-24T21:22:17Z">March 24, 2019</time>
# 2 <time class="timeago" datetime="2019-03-31T19:34:15Z">March 31, 2019</time>
# 3 <time class="timeago" datetime="2019-03-30T00:45:08Z">March 30, 2019</time>
# 4 <time class="timeago" datetime="2019-03-23T00:48:20Z">March 23, 2019</time>
# 5 <time class="timeago" datetime="2019-03-23T00:48:20Z">March 23, 2019</time>
#
# $authUrls
# $authUrls$`facebook`
# [1] "https://www.facebook.com/v2.9/dialog/oauth?access_type=offline&client_id=284597785309&redirect_uri=https%3A%2F%2Fwww.strava.com%2Fo_auth%2Ffacebook&response_type=code&scope=email&state=%7B%22context%22%3A%22facebook_web_signup_flow_v1%22%2C%22state%22%3A%22eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdGF0ZV9wYXJhbSI6IjdxYnRrdTA2NjdsNmduMWlsZWFvZXZyYWgyZ2swamNjIn0.qLV9KlcRJWBP2royVFHUtSimlQQywS8ZrxdJ-brZjKg%22%2C%22with_newsletter%22%3Afalse%7D"
#
# $authUrls$google
# [1] "https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=541588808765.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fwww.strava.com%2Fo_auth%2Fgoogle&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.me+email+profile&state=%7B%22context%22%3A%22google_web_signup_flow_v1%22%2C%22state%22%3A%22eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdGF0ZV9wYXJhbSI6IjdxYnRrdTA2NjdsNmduMWlsZWFvZXZyYWgyZ2swamNjIn0.qLV9KlcRJWBP2royVFHUtSimlQQywS8ZrxdJ-brZjKg%22%7D"
#
# $authUrls$email
# [1] "/register/free?cta=sign-up&source=footer-upsell"
#
#
# $analyticsData
# $analyticsData$`category`
# [1] "athletes"
#
# $analyticsData$page
# [1] "athlete_profile"
Great news, thanks a lot for doing this Marcus, really appreciate your effort!
//Martin
On Tue, Apr 2, 2019 at 11:02 PM Marcus W Beck notifications@github.com wrote:
I looked into this a bit more and I think I found a solution. The new format of the public web pages doesn't have all of the info that was in the previous, but you can still get quite a bit. I will have to work this in to a new function.
library(rvest) library(V8) url_in <- 'https://www.strava.com/athletes/2837007'athl <- url_in %>% read_html %>% html_nodes("[data-react-class]") %>% xml_attr('data-react-props') %>% v8()$get(.) athl# $
athlete
# $athlete
$name
# [1] "Marcus Beck"# # $athlete
$location# [1] "Irvine, California"# # $athlete
$avatarUrl# [1] "https://dgalywyr863hv.cloudfront.net/pictures/athletes/2837007/900880/4/large.jpg"# # $athlete
$primarySport# [1] "athlete-cyclist"# # $athlete
$followersCount# [1] 74# # $athlete
$followingCount# [1] 74# # $athlete
$followUrl# [1] "https://www.strava.com/register?content=2837007&cta=follow&element=button&follow_athlete_after_login=true&follow_athlete_after_registration=true&follow_athlete_id=2837007&source=route"# # # $trophies# list()# # $recentActivities
# id name type description startDateLocal distance elevation movingTime# 1 2259675934 Morning Ride ride NA Yesterday 10.6 mi 51 ft 40:28# 2 2258696770 Afternoon Ride ride NA Yesterday 10.7 mi 117 ft 43:23# 3 2257254459 Morning Ride ride NA March 31, 2019 10.6 mi 51 ft 40:24# images# 1 map, TRUE, Morning Ride, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/600x280.jpg?request=ZmFsc2UgMjI1OTY3NTkzNA==&signature=6350cfdf25942ac9b919ffe297e93a26d2fea2c401fd80f13b5f2b7cc66d8526&activityVersion=e820073, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/280x280.jpg?request=ZmFsc2UgMjI1OTY3NTkzNA==&signature=6350cfdf25942ac9b919ffe297e93a26d2fea2c401fd80f13b5f2b7cc66d8526&activityVersion=e820073# 2 map, TRUE, Afternoon Ride, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/600x280.jpg?request=ZmFsc2UgMjI1ODY5Njc3MA==&signature=6471ed645a00ecca17390234fc4440aae0f73fbbae7cfc8bebeb3a99b76f15bc&activityVersion=5c76240, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/280x280.jpg?request=ZmFsc2UgMjI1ODY5Njc3MA==&signature=6471ed645a00ecca17390234fc4440aae0f73fbbae7cfc8bebeb3a99b76f15bc&activityVersion=5c76240# 3 map, TRUE, Morning Ride, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/600x280.jpg?request=ZmFsc2UgMjI1NzI1NDQ1OQ==&signature=77dd1bb914ac16d187435f630f963d1d97d4bbeec5fa590945751e6caddc6bbc&activityVersion=7200e12, https://d2u2bkuhdva5j0.cloudfront.net/activities-v2/2/280x280.jpg?request=ZmFsc2UgMjI1NzI1NDQ1OQ==&signature=77dd1bb914ac16d187435f630f963d1d97d4bbeec5fa590945751e6caddc6bbc&activityVersion=7200e12# isManual hasGps# 1 FALSE TRUE# 2 FALSE TRUE# 3 FALSE TRUE# # $stats# $stats$monthlyDistance
# [1] "32.0 mi"# # $stats$monthlyTime# [1] "2:04:15"# # $stats$chartData# month miles hours elev_gain# 1 2018-10-01 329.08191 23 1521# 2 2018-11-01 248.76223 18 955# 3 2018-12-01 161.58634 14 964# 4 2019-01-01 391.10905 28 1110# 5 2019-02-01 247.53005 18 679# 6 2019-03-01 343.69594 24 1039# 7 2019-04-01 32.08015 2 66# # # $achievements# description showTrophy spriteName# 1 2nd best estimated 10k effort TRUE icon-at-pr-2# 2 PR on Race the Northbound Train TRUE icon-at-pr-1# 3 PR on Main St. Mortal Kombat TRUE icon-at-pr-1# 4 PR on NB Warner to ICD TRUE icon-at-pr-1# 5 PR on Harvard - Warner to Walnut TRUE icon-at-pr-1# timeago# 1 # 2 # 3 # 4 # 5 # # $authUrls# $authUrls$category
# [1] "athletes"# # $analyticsData$page# [1] "athlete_profile"— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fawda123/rStrava/issues/53#issuecomment-479200621, or mute the thread https://github.com/notifications/unsubscribe-auth/AMvmKJIDsyQCD5lIbOkavNYRb2bDXFOkks5vc8U6gaJpZM4b5O-R .
Hi Martin,
I've got a new version of athl_fun()
working - it scrapes most of the relevant info from the new page format.
Athletes <- c(1837688, 12767051, 7207454, 12762229, 25723993, 16473726, 2676921)
data.df <- athl_fun(Athletes, trace = TRUE)
# 1837688 1 of 7
# 12767051 2 of 7
# 7207454 3 of 7
# 12762229 4 of 7
# 25723993 5 of 7
# 16473726 6 of 7
# 2676921 7 of 7
data.df
# $`1837688`
# $`1837688`$`name`
# [1] "Martin Tengelin"
#
# $`1837688`$location
# [1] "Nyon, Vaud, Switzerland"
#
# $`1837688`$units
# [1] "km" "m"
#
# $`1837688`$monthly
# month miles hours elev_gain
# 1 2018-10-01 106.509 11 1315
# 2 2018-11-01 134.414 13 1208
# 3 2018-12-01 93.511 9 991
# 4 2019-01-01 197.163 16 1100
# 5 2019-02-01 101.270 12 1040
# 6 2019-03-01 95.520 10 712
# 7 2019-04-01 15.337 1 131
#
# $`1837688`$recent
# id name type startDateLocal distance elevation movingTime
# 1 2272619446 5*1000m @ 3:55/km run 2019-04-07 10.0 80 44:48
# 2 2264609505 Calorie neutral now? run 2019-04-04 5.3 51 25:15
# 3 2257403103 Pumping Iron workout 2019-04-01 0.0 0 29:31
#
# $`1837688`$achievements
# description timeago
# 1 PR on Piste 1000m Colovray 2019-04-07 14:54:35
# 2 PR on La Plage to La Nautique, along the lake 2019-03-31 11:19:55
# 3 PR on Along Boiron, from the railway 2019-03-31 11:19:55
# 4 PR on forest trail 2019-03-20 15:19:30
# 5 PR on La taverne de l'ours russe 2019-03-19 16:38:24
#
#
# $`12767051`
# $`12767051`$`name`
# [1] "Steve Carrington"
#
# $`12767051`$location
# [1] "Jersey City , New Jersey "
#
# $`12767051`$units
# [1] "km" "m"
#
# $`12767051`$monthly
# month miles hours elev_gain
# 1 2018-10-01 28.560 2 261
# 2 2018-11-01 23.096 2 85
# 3 2018-12-01 13.135 1 74
# 4 2019-01-01 9.565 0 35
# 5 2019-02-01 18.058 1 37
# 6 2019-03-01 4.241 0 4
# 7 2019-04-01 0.000 0 0
#
# $`12767051`$recent
# id name type startDateLocal distance elevation movingTime
# 1 2253073428 Spring into action run 2019-03-30 4.2 5 24:03
#
# $`12767051`$achievements
# description timeago
# 1 2nd fastest time on Catch the lights 2019-03-30 21:07:36
#
#
# $`7207454`
# $`7207454`$`name`
# [1] "bram graveland"
#
# $`7207454`$location
# [1] "Genève, Genève, Switzerland"
#
# $`7207454`$units
# character(0)
#
# $`7207454`$monthly
# month miles hours elev_gain
# 1 2018-10-01 21.716 2 213
# 2 2018-11-01 23.849 2 233
# 3 2018-12-01 11.612 1 143
# 4 2019-01-01 101.782 7 1501
# 5 2019-02-01 5.783 0 56
# 6 2019-03-01 0.000 0 0
# 7 2019-04-01 0.000 0 0
#
# $`7207454`$recent
# function (...) .Primitive("list")
#
# $`7207454`$achievements
# list()
#
#
# $`12762229`
# $`12762229`$`name`
# [1] "Matteo Vasirani"
#
# $`12762229`$location
# [1] ""
#
# $`12762229`$units
# [1] "km" "m"
#
# $`12762229`$monthly
# month miles hours elev_gain
# 1 2018-10-01 6.193 5 159
# 2 2018-11-01 42.216 5 509
# 3 2018-12-01 49.813 7 1170
# 4 2019-01-01 15.104 5 36784
# 5 2019-02-01 67.115 7 3533
# 6 2019-03-01 72.638 8 671
# 7 2019-04-01 7.159 0 155
#
# $`12762229`$recent
# id name type startDateLocal distance elevation movingTime
# 1 2269612083 Afternoon Run run 2019-04-06 7.1 155 44:22
# 2 2255285672 Afternoon Run run 2019-03-31 7.1 60 40:44
# 3 2254087007 La Ballade à Béatrix with Benny hike 2019-03-31 1.7 43 32:16
#
# $`12762229`$achievements
# description timeago
# 1 PR on Chemin du Stand 2019-03-16 15:51:09
# 2 PR on Rt de l'Etraz - Vich 2019-03-09 11:05:39
# 3 PR on Pont Farbel - Vich (Toblerones) 2019-03-09 07:59:38
# 4 2nd fastest time on Chemin des Toblerones 2019-03-31 15:01:44
# 5 2nd fastest time on Rt de l'Etraz - Vich 2019-03-09 07:59:38
#
#
# $`25723993`
# $`25723993`$`name`
# [1] "Ravi Gogte"
#
# $`25723993`$location
# [1] ""
#
# $`25723993`$units
# [1] "km" "m"
#
# $`25723993`$monthly
# month miles hours elev_gain
# 1 2018-10-01 25.496 2 272
# 2 2018-11-01 10.880 1 6
# 3 2018-12-01 14.078 1 126
# 4 2019-01-01 25.134 2 32
# 5 2019-02-01 5.399 0 12
# 6 2019-03-01 38.118 4 267
# 7 2019-04-01 0.000 0 0
#
# $`25723993`$recent
# id name type startDateLocal distance elevation movingTime
# 1 2251079146 Morning Run run 2019-03-30 10.5 97 1:07:19
# 2 2241279251 Morning Run run 2019-03-26 8.7 59 54:27
# 3 2227468637 Evening Run run 2019-03-20 6.8 36 44:20
#
# $`25723993`$achievements
# description timeago
# 1 PR on Port à port 2019-03-30 08:47:30
# 2 2nd fastest time on escalade downhill 2019-03-30 08:47:30
# 3 2nd fastest time on Bordul depuis Genève - plage 2019-03-30 08:47:30
# 4 2nd fastest time on Chemin derrière Bout-du-Monde 2019-03-26 06:50:37
# 5 2nd fastest time on Le sprint à Tombet 2019-03-11 06:10:43
#
#
# $`16473726`
# $`16473726`$`name`
# [1] "Adrien dc"
#
# $`16473726`$location
# [1] "Genève, Genève, Switzerland"
#
# $`16473726`$units
# [1] "km" "m"
#
# $`16473726`$monthly
# month miles hours elev_gain
# 1 2018-10-01 95.698 11 1834
# 2 2018-11-01 105.770 12 2505
# 3 2018-12-01 84.546 9 1085
# 4 2019-01-01 115.885 11 1209
# 5 2019-02-01 82.520 7 692
# 6 2019-03-01 135.265 12 1180
# 7 2019-04-01 15.871 1 114
#
# $`16473726`$recent
# id name type startDateLocal distance elevation movingTime
# 1 2268250834 Course à pied matinale run 2019-04-06 10.2 52 49:57
# 2 2259586122 Course à pied l'après-midi run 2019-04-02 5.6 62 27:04
# 3 2252178716 Course à pied l'après-midi run 2019-03-30 5.7 34 27:56
#
# $`16473726`$achievements
# description timeago
# 1 PR on Duin omhoog 2019-04-06 07:39:08
# 2 PR on Paquis 2019-03-28 10:12:33
# 3 PR on Straight line in the park 2019-03-28 10:12:33
# 4 PR on Jardin Botanique - Inner Inner loop 2019-03-28 10:12:33
# 5 PR on Mon-Repos straight 2019-03-28 10:12:33
#
#
# $`2676921`
# $`2676921`$`name`
# [1] "David Jackson"
#
# $`2676921`$location
# [1] "Veyrier, Switzerland, United Kingdom"
#
# $`2676921`$units
# [1] "km" "m"
#
# $`2676921`$monthly
# month miles hours elev_gain
# 1 2018-10-01 0.000 0 0
# 2 2018-11-01 0.000 0 0
# 3 2018-12-01 0.000 0 0
# 4 2019-01-01 72.396 6 510
# 5 2019-02-01 28.195 2 148
# 6 2019-03-01 90.314 8 820
# 7 2019-04-01 29.972 2 216
#
# $`2676921`$recent
# id name type startDateLocal distance elevation movingTime
# 1 2268635348 Toon with Han Bill run 2019-04-06 17.1 81 1:37:23
# 2 2266810074 Morning Run run 2019-04-03 12.8 135 1:11:58
# 3 2250800185 Saturday Workout run 2019-03-30 8.1 65 44:07
#
# $`2676921`$achievements
# description timeago
# 1 Best estimated 10 mile effort 2019-04-06 09:18:29
# 2 Best estimated 15k effort 2019-04-06 09:18:29
# 3 Best estimated 10k effort 2019-04-06 09:18:29
# 4 2nd best estimated 10k effort 2019-03-24 08:35:08
# 5 3rd best estimated 5k effort 2019-03-24 08:35:08
Excellent, thanks a lot for doing this Marcus, very appreciated. I’ll update the package and try it out.
//Martin
From: Marcus W Beck notifications@github.com Sent: Sunday, April 7, 2019 6:52 PM To: fawda123/rStrava Cc: Martin Tengelin; Author Subject: Re: [fawda123/rStrava] Unable to scrape athlete data with athl_fun() (#53)
Hi Martin,
I've got a new version of athl_fun() working - it scrapes most of the relevant info from the new page format.
Athletes <- c(1837688, 12767051, 7207454, 12762229, 25723993, 16473726, 2676921)data.df <- athl_fun(Athletes, trace = TRUE)# 1837688 1 of 7 # 12767051 2 of 7 # 7207454 3 of 7 # 12762229 4 of 7 # 25723993 5 of 7 # 16473726 6 of 7 # 2676921 7 of 7 data.df# $1837688
# $1837688
$name
# [1] "Martin Tengelin"# # $1837688
$location# [1] "Nyon, Vaud, Switzerland"# # $1837688
$units# [1] "km" "m" # # $1837688
$monthly# month miles hours elev_gain# 1 2018-10-01 106.509 11 1315# 2 2018-11-01 134.414 13 1208# 3 2018-12-01 93.511 9 991# 4 2019-01-01 197.163 16 1100# 5 2019-02-01 101.270 12 1040# 6 2019-03-01 95.520 10 712# 7 2019-04-01 15.337 1 131# # $1837688
$recent# id name type startDateLocal distance elevation movingTime# 1 2272619446 5*1000m @ 3:55/km run 2019-04-07 10.0 80 44:48# 2 2264609505 Calorie neutral now? run 2019-04-04 5.3 51 25:15# 3 2257403103 Pumping Iron workout 2019-04-01 0.0 0 29:31# # $1837688
$achievements# description timeago# 1 PR on Piste 1000m Colovray 2019-04-07 14:54:35# 2 PR on La Plage to La Nautique, along the lake 2019-03-31 11:19:55# 3 PR on Along Boiron, from the railway 2019-03-31 11:19:55# 4 PR on forest trail 2019-03-20 15:19:30# 5 PR on La taverne de l'ours russe 2019-03-19 16:38:24# # # $12767051
# $12767051
$name
# [1] "Steve Carrington"# # $12767051
$location# [1] "Jersey City , New Jersey "# # $12767051
$units# [1] "km" "m" # # $12767051
$monthly# month miles hours elev_gain# 1 2018-10-01 28.560 2 261# 2 2018-11-01 23.096 2 85# 3 2018-12-01 13.135 1 74# 4 2019-01-01 9.565 0 35# 5 2019-02-01 18.058 1 37# 6 2019-03-01 4.241 0 4# 7 2019-04-01 0.000 0 0# # $12767051
$recent# id name type startDateLocal distance elevation movingTime# 1 2253073428 Spring into action run 2019-03-30 4.2 5 24:03# # $12767051
$achievements# description timeago# 1 2nd fastest time on Catch the lights 2019-03-30 21:07:36# # # $7207454
# $7207454
$name
# [1] "bram graveland"# # $7207454
$location# [1] "Genève, Genève, Switzerland"# # $7207454
$units# character(0)# # $7207454
$monthly# month miles hours elev_gain# 1 2018-10-01 21.716 2 213# 2 2018-11-01 23.849 2 233# 3 2018-12-01 11.612 1 143# 4 2019-01-01 101.782 7 1501# 5 2019-02-01 5.783 0 56# 6 2019-03-01 0.000 0 0# 7 2019-04-01 0.000 0 0# # $7207454
$recent# function (...) .Primitive("list")# # $7207454
$achievements# list()# # # $12762229
# $12762229
$name
# [1] "Matteo Vasirani"# # $12762229
$location# [1] ""# # $12762229
$units# [1] "km" "m" # # $12762229
$monthly# month miles hours elev_gain# 1 2018-10-01 6.193 5 159# 2 2018-11-01 42.216 5 509# 3 2018-12-01 49.813 7 1170# 4 2019-01-01 15.104 5 36784# 5 2019-02-01 67.115 7 3533# 6 2019-03-01 72.638 8 671# 7 2019-04-01 7.159 0 155# # $12762229
$recent# id name type startDateLocal distance elevation movingTime# 1 2269612083 Afternoon Run run 2019-04-06 7.1 155 44:22# 2 2255285672 Afternoon Run run 2019-03-31 7.1 60 40:44# 3 2254087007 La Ballade à Béatrix with Benny hike 2019-03-31 1.7 43 32:16# # $12762229
$achievements# description timeago# 1 PR on Chemin du Stand 2019-03-16 15:51:09# 2 PR on Rt de l'Etraz - Vich 2019-03-09 11:05:39# 3 PR on Pont Farbel - Vich (Toblerones) 2019-03-09 07:59:38# 4 2nd fastest time on Chemin des Toblerones 2019-03-31 15:01:44# 5 2nd fastest time on Rt de l'Etraz - Vich 2019-03-09 07:59:38# # # $25723993
# $25723993
$name
# [1] "Ravi Gogte"# # $25723993
$location# [1] ""# # $25723993
$units# [1] "km" "m" # # $25723993
$monthly# month miles hours elev_gain# 1 2018-10-01 25.496 2 272# 2 2018-11-01 10.880 1 6# 3 2018-12-01 14.078 1 126# 4 2019-01-01 25.134 2 32# 5 2019-02-01 5.399 0 12# 6 2019-03-01 38.118 4 267# 7 2019-04-01 0.000 0 0# # $25723993
$recent# id name type startDateLocal distance elevation movingTime# 1 2251079146 Morning Run run 2019-03-30 10.5 97 1:07:19# 2 2241279251 Morning Run run 2019-03-26 8.7 59 54:27# 3 2227468637 Evening Run run 2019-03-20 6.8 36 44:20# # $25723993
$achievements# description timeago# 1 PR on Port à port 2019-03-30 08:47:30# 2 2nd fastest time on escalade downhill 2019-03-30 08:47:30# 3 2nd fastest time on Bordul depuis Genève - plage 2019-03-30 08:47:30# 4 2nd fastest time on Chemin derrière Bout-du-Monde 2019-03-26 06:50:37# 5 2nd fastest time on Le sprint à Tombet 2019-03-11 06:10:43# # # $16473726
# $16473726
$name
# [1] "Adrien dc"# # $16473726
$location# [1] "Genève, Genève, Switzerland"# # $16473726
$units# [1] "km" "m" # # $16473726
$monthly# month miles hours elev_gain# 1 2018-10-01 95.698 11 1834# 2 2018-11-01 105.770 12 2505# 3 2018-12-01 84.546 9 1085# 4 2019-01-01 115.885 11 1209# 5 2019-02-01 82.520 7 692# 6 2019-03-01 135.265 12 1180# 7 2019-04-01 15.871 1 114# # $16473726
$recent# id name type startDateLocal distance elevation movingTime# 1 2268250834 Course à pied matinale run 2019-04-06 10.2 52 49:57# 2 2259586122 Course à pied l'après-midi run 2019-04-02 5.6 62 27:04# 3 2252178716 Course à pied l'après-midi run 2019-03-30 5.7 34 27:56# # $16473726
$achievements# description timeago# 1 PR on Duin omhoog 2019-04-06 07:39:08# 2 PR on Paquis 2019-03-28 10:12:33# 3 PR on Straight line in the park 2019-03-28 10:12:33# 4 PR on Jardin Botanique - Inner Inner loop 2019-03-28 10:12:33# 5 PR on Mon-Repos straight 2019-03-28 10:12:33# # # $2676921
# $2676921
$name
# [1] "David Jackson"# # $2676921
$location# [1] "Veyrier, Switzerland, United Kingdom"# # $2676921
$units# [1] "km" "m" # # $2676921
$monthly# month miles hours elev_gain# 1 2018-10-01 0.000 0 0# 2 2018-11-01 0.000 0 0# 3 2018-12-01 0.000 0 0# 4 2019-01-01 72.396 6 510# 5 2019-02-01 28.195 2 148# 6 2019-03-01 90.314 8 820# 7 2019-04-01 29.972 2 216# # $2676921
$recent# id name type startDateLocal distance elevation movingTime# 1 2268635348 Toon with Han Bill run 2019-04-06 17.1 81 1:37:23# 2 2266810074 Morning Run run 2019-04-03 12.8 135 1:11:58# 3 2250800185 Saturday Workout run 2019-03-30 8.1 65 44:07# # $2676921
$achievements# description timeago# 1 Best estimated 10 mile effort 2019-04-06 09:18:29# 2 Best estimated 15k effort 2019-04-06 09:18:29# 3 Best estimated 10k effort 2019-04-06 09:18:29# 4 2nd best estimated 10k effort 2019-03-24 08:35:08# 5 3rd best estimated 5k effort 2019-03-24 08:35:08
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/fawda123/rStrava/issues/53#issuecomment-480609441, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMvmKBQ0tTpvXmbtaS3_U0PJP0LQq8CSks5veiJTgaJpZM4b5O-R.
Marcus, thanks again for the update of the function. Like you say, the output is slightly different but it contains the most important info. One thing that I miss though from the previous output is the year-to-date summary, which only contained the distance etc of your selected favourite activity (running or biking). The current $monthly output contains all activity types combined without possibility to separate e.g. running from biking. Any chance to get the year-to-date information as well (seems to be on the athlete profile page)?
Also, I get an error for the function when running it for one of my athletes (38149314).
athl_fun(38149314, trace = FALSE) Error in as.Date.default(out$month, format = "%Y-%m-%d") : do not know how to convert 'out$month' to class “Date” $
38149314
[1] NA
Okay, I fixed the issue for the error on your athlete. That person's page has limited information so I needed to write an exception if the monthly data were unavailable.
Unfortunately I do not see the year-to-date summaries on the public facing profiles. I do see it on my personal page but only after I login. I can also see other athlete's summaries after I login. I don't know how this info can be accessed using R since I have to manually login to the web browser to see it myself.
Hello,
Since yesterday (at least), the athl_fun() is unable to retrieve data, generating the following error message: