Skip to content

AnandChowdhary/services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

98 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”§ Services

These are microservices for automating everyday tasks, written in TypeScript/Node.js and deployed to ZEIT.

Endpoint: services.anandchowdhary.now.sh/api

⭐ Endpoints

/wikipedia-summary

Returns the introductory text for a search term. Try it β†’

Query param Description Example
q Search query Oswald Labs
limit Max length of summary 300
min Minimum length of summary 8
cacheAge Seconds to cache for 86400

/github-contributors

Returns an SVG image with profile pictures of contributors of a repository on GitHub. Try it β†’

Query param Description Example
repo GitHub repository path elninotech/uppload
width Profile picture width in pixels 85
itemsPerLine Number of pictures per line 8
padding Padding between pictures in pixels 5
cacheAge Seconds to cache for 86400

Contributors

/github-members

Returns an SVG image with profile pictures of members of a repository on GitHub. Try it β†’

Query param Description Example
org GitHub organization name elninotech
width Profile picture width in pixels 85
itemsPerLine Number of pictures per line 8
padding Padding between pictures in pixels 5
cacheAge Seconds to cache for 86400

Contributors

/github-files

Returns a Shields.io schema for a badge with the number of files in a GitHub repository's directory. Try it β†’

Badge example

Query param Description Example
repo GitHub repository path elninotech/uppload
path Directory path src/i18n
add1 Add to number of files 0
subtract1 Subtract from number of files 1
label Shield label i18n
message2 Shield message $1$ language$S$
color Shield color blueviolet
cacheAge Seconds to cache for 3600
  • 1 Add and subtract numbers can be used, for example, to subtract the index.html file and return the number of content files
  • 2 Special variables $1$ and $S$ are replaced with the number of files and pluralized "s" respectively

Life data endpoints

These endpoints are used as webhooks for a cron job, and fetch data from various web services' APIs and update my Life Data GitHub repo.

Endpoint Description File
/spotify My top artists data from Spotify top-artists.yml
/wakatime My programming data from Wakatime development.yml
/owntracks My real-time location from OwnTracks location.json
/yoga My heart rate from HealthKit heart-rate.yml
/yoga My step count from HealthKit step-count.yml
/yoga My flights climbed from HealthKit flights-climbed.yml
/yoga My distance from HealthKit distance.yml
/yoga My active energy from HealthKit active-energy.yml
/yoga My basal energy from HealthKit basal-energy.yml
/instagram-highlights My story highlights from Instagram instagram-highlights.json
/pocket-casts My podcasts list from Pocket Casts podcasts.yml
/pocket-casts My listening history from Pocket Casts podcast-history.yml
/gmail My email summary from Gmail emails.yml

πŸ’» Development

Several secret keys are required to run these services, particularly my private access tokens for third-party services.

  • Locally, they are available in the .env file.
  • On Now, they come from now.json using Now Secrets
  • As backup, the are available in this repo in secrets.gpg, using the public key public.asc (also on OpenPGP)

πŸ“„ License

MIT Β© Anand Chowdhary

About

πŸ”§ Node.js serverless microservices for automating things

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published