Skip to content

Node.js API for generating GitHub badges depending on a repository's mood πŸŒΈπŸ”΅β˜€οΈπŸŒƒ

Notifications You must be signed in to change notification settings

healeycodes/project-mood

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Build Status

Project Mood

Create a badge by pointing an image markup tag to /:owner/:repo.svg e.g. /healeycodes/project-mood.svg. The API works with any public repository.

Git commits are scanned using the GitHub API to create a dynamic badge based off average commit time.

SVGs will have the average commit time as hover text via the inner-SVG tag <title>.


Roadmap πŸš—

If I continue working on this, these are the things that will need to be addressed:

  • Caching:
    • Repositories should be scanned infrequently rather than per request.
    • We can store the most recently requested SVGs in memory.
    • Basically, don't generate the SVG for every request (which is used for the prototype).
  • Blended colors depending on average time rather than fixed colors.

Install

npm i


Authentication

For running and testing, set GHTOKEN to your GitHub personal access token, and USERAGENT to a custom user-agent (required by GitHub).


Run

(Optional) set a port via PORT -- 8080 by default.

npm start


Test

This repo uses Travis CI which currently builds and tests for commits/branches/PRs

The test framework is Mocha/SuperTest.

Set NODE_ENV to test.

npm test

  GET /healeycodes/project-mood
    √ responds with an SVG (586ms)

  GET /healeycodes/missing-or-mispelled-project
    √ responds with the default errored SVG (395ms)

About

Node.js API for generating GitHub badges depending on a repository's mood πŸŒΈπŸ”΅β˜€οΈπŸŒƒ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published