Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lowmess/stats
Unified 30 day stats API
https://github.com/lowmess/stats
graphql typescript
Last synced: 24 days ago
JSON representation
Unified 30 day stats API
- Host: GitHub
- URL: https://github.com/lowmess/stats
- Owner: lowmess
- License: mit
- Created: 2018-01-09T07:20:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T03:07:10.000Z (over 1 year ago)
- Last Synced: 2023-08-06T02:44:48.315Z (over 1 year ago)
- Topics: graphql, typescript
- Language: TypeScript
- Homepage: https://stats.lowmess.com/
- Size: 2.47 MB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stats API
Little stats counters for [my about page](https://lowmess.com/about/)
### App secrets
This pad contains some secret keys which you will need to provide as environment variables. Use [a `.env` to that locally](https://zeit.co/docs/v2/development/environment-variables/), and [`now` secrets to do it in production](https://zeit.co/docs/v2/deployments/environment-variables-and-secrets/).
Here's the keys you need:
- `AWS_ACCESS` - AWS access key ID
- `AWS_SECRET` - AWS secret access key
- `AWS_BUCKET` - Bucket name to find `withings.json` (see below)
- `FOURSQUARE_KEY` - Foursquare OAuth token
- `GITHUB_KEY` - GitHub personal access token
- `GOODREADS_KEY` - Goodreads API key
- `GOODREADS_ID` - Goodreads user ID to look up
- `LASTFM_KEY` - Last.fm OAuth token
- `LASTFM_USERNAME` - Last.fm username to look up
- `TWITTER_KEY` - Twitter OAuth bearer token
- `WITHINGS_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`.