Unified 30 day stats API
MIT License
Little stats counters for my about page
This pad contains some secret keys which you will need to provide as environment variables. Use a .env
to that locally, and now
secrets to do it in production.
Here's the keys you need:
AWS_ACCESS
- AWS access key IDAWS_SECRET
- AWS secret access keyAWS_BUCKET
- Bucket name to find withings.json
(see below)FOURSQUARE_KEY
- Foursquare OAuth tokenGITHUB_KEY
- GitHub personal access tokenGOODREADS_KEY
- Goodreads API keyGOODREADS_ID
- Goodreads user ID to look upLASTFM_KEY
- Last.fm OAuth tokenLASTFM_USERNAME
- Last.fm username to look upTWITTER_KEY
- Twitter OAuth bearer tokenWITHINGS_CLIENT_ID
- Withings Client ID (for OAuth token refresh)WITHINGS_CLIENT_SECRET
- Withings Client Secret (for OAuth token refresh)Why do I need AWS credentials?
Because Withings sucks. Unlike the other services here, the OAuth tokens Withings provides has an exceedingly short lifespan (about 3 hours). This means that we need a way to store and update those tokens more than the occassional redeploy with new keys. If I was developing this from scratch, instead of updating my previous work (the first version of this API used FitBit, but I wanted a nicer watch smh), I would likely just make a full-on server with database instead of this half-serverless thing I've got going on.
Anyways, it's exceedingly important than the provided bucket has a withings.json
object containing, at minimum, an access_token
and refresh_token
.