App : http://www.cyclefriend.me
Twitter : @philipbeel
Cycle friend finder Helps you find athletes and discover routes where you live.
Install all dependencies:
$ node npm install
Create an Strava developer account https://www.strava.com/developers
Create a directory called /data
. Create a file in this directory called strava_config
In strava_config
add the following, including your credentials from you developer account:
{
"access_token" :""
, "client_id" :""
, "client_secret" :""
, "redirect_uri" :""
}
Run the node script.
$ node cycle.js
This will start a node server at http://localhost:8088
, visit the href to view the app running.
When I moved to to a new town I wanted to find great cycling routes. This is a tricky task on Strava when you don't know anyone living nearby. Rather than trundling through Strava segments and hoping the athletes live round the corner I wrote this tool to do things programmatically.
Using Stravas V3 API, and when passed a valid athlete ID the following chain of events take place:
- A lookup is done on the athlete id passed in to get back the
city
,town
andstate
- Assuming this information is present a request for the southwest Lat/Long and northeast Lat/Long is performed against the google maps API for the athletes geo location
- The co-ordinates are then used to lookup Strava segments within the bounds
- For every matched segment the first page of
male
athletes ID's are retrieved and stored - A request is then made against each athlete to get their home location
- For all athletes that live in the same location as the athlete ID passed in a filtered list is generated.
- Results list is provided through the UI.