Updates the description of Strava activities with split and weather info. Designed to be used with running type activities although there currently is no check in place to prevent other activities from being processed.
Description will be updated to the following format:
SCHEMA
<original description>
[SPLITS]
distance elapsed moving pace
metres MM:ss MM:ss "/km "/mi
[WEATHER]
xx.x°F <condition>, feels like xx.x°F, Humidity xx.xx%, Wind xx.xmph from ↻ xx°NE w/ xx.xmph gusts, Clouds Cover xx.x%, UV Index xEXAMPLE
[SPLITS]
[00] 1609.34m > 9:21, 8:35 @ 5:21/km 8:36/mi
[01] 1609.34m > 21:48, 8:30 @ 5:16/km 8:29/mi
[02] 1609.34m > 8:57, 8:08 @ 5:03/km 8:08/mi
[03] 79.95m > 0:29, 0:24 @ 5:00/km 8:03/mi
[WEATHER]
73.1°F Partially cloudy, feels like 73.1°F, Humidity 29.71%, Wind 8.8mph from ↑ 354°N w/ 18.3mph gusts, Clouds Cover 41.5%, UV Index 4Currently this is not a full proof application. For example, values within the settings.json file are not validated against invalid inputs. Not all errors are caught so fatal errors can occur if used improperly. There is currently no user friendly way to remove a user other than deleting the user's strava_oauth/<id>.json
- Have Node.JS installed on your computer.
- Install from the Downloads page, or install using the proper package manager.
If you want to develop make sure NPM is also downloaded.
Visit Strava's Getting Started page to learn how to create your Strava app in Section B.
- go to My API Application
- Name your application
- Choose any category
- Set a website if you have one or use example.com
- Set Authorization Callback Domain to localhost
- Info on this page will be needed to update settings.json
- Create an account with Big Data Cloud
- Choose the free plan
- Go to Account in upper right corner.
- Create an API key if asked.
- Take note of the "ApiKey"
- Create an account with VisualCrossing
- Choose the free tier when asked.
- Then go to Account in the upper right corner.
- Take note of the "Key"
~> git clone https://github.com/ifrog800/StravaAddon.git
~/StravaAddon> cd StravaAddonChange the values to edit the application's configurable settings.
{
// the port the webserver will be running on
"port": 4747,
// CHANGE to your Strava app's Client ID
"client_id": 11111,
// CHANGE to your Strava app's Client Secret
"client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
// the directory where data will be saved to, use any path Node.JS can resolve to
"data_dir": "./.strava_addon_data",
// store the data in compressed .json.gz format to save disk space
// WARNING: If changed from true to false or vice versa, all cached data will need to be re-downloaded counting towards quotas/rate limits, change at own discretion
"gzip_comp_data": true,
// the string to look for so duplicate activity processing is not done
"description_ending": "<<《Strava Addon》>>",
// api keys, DO NOT SHARE!!!!!!!!
"api": {
// replace with the API Key found in step 2
"bigdatacloud": "API_KEY_HERE",
// replace with the API Key found in step 3
"visualcrossing": "API_KEY_HERE"
},
// maps the VisualCrossing icon name to an emoji
"weather_icons": {
"clear-day": "☀️",
"clear-night": "🌙",
"cloudy": "☁️",
"fog": "🌫️",
"hail": "⚪",
"partly-cloudy-day": "⛅",
"partly-cloudy-night": "",
"rain-snow-showers-day": "🌨️",
"rain-snow-showers-night": "🌨️",
"rain-snow": "🌨️",
"rain": "🌧️",
"showers-day": "🌧️",
"showers-night": "🌧️",
"snow": "❄️",
"thunder-rain": "⛈️",
"thunder-showers-day": "⛈️",
"thunder-showers-night": "⛈️",
"thunder": "⚡",
"wind": "💨"
}
}Open a terminal.
(Command Prompt or Ctl + Alt + T)
# change directory to where the git cloned repo is
~> cd StravaAddon
# run the application
~/StravaAddon> node src/server.jsOpen a web browser and navigate to http://localhost:4747 to connect with your Strava
After connecting may need to restart application for it to work. Spam Ctrl + C until the program quits. Then press ↑ up arrow key and enter to restart.
There are rate limits on the API's used within this application. There is no check to ensure the user is following rates. The program will error through any rate limited resources.
-
- every 15 mins on the clock, limited to 100 API requests
- every day limited to 1000 API requests
-
- 50k reverse geo-code queries per month
-
- 1000 credits per day
- each historical lookup is 24 credits
- so only 1000/24 = 41 lookups a day