commitscrape

command module
v0.0.0-...-a4c672f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

README

Screenshot of commitscrape in action

commitscrape

GitHub calendars as a service, built in Go. Scrapes a GitHub profile for the pretty commit calendar, converts it from an SVG to classed divs, caches it to Redis, and serves it up in a JSON response.

Setup

Install Redis and Go. Ensure Redis is running.

  1. go get this repository.
  2. Edit config.toml with your preferred settings.
  3. go build and run the binary.

API

  • GET / : Retrieves GitHub calendar.
Possible query strings:
  • ?columns=<column count> : Only returns specified column count. Must be a number between 0 and 53.

Example front-end setup

JavaScript
fetch('<COMMITSCRAPE URL>/?columns=<OPTIONAL AMOUNT OF COLUMNS>')
  .then(response => {
    return response.json()
  })
  .then(res => {
    document.querySelector('#commits').innerHTML = res.html
  })
CSS
.commitscrape-0 { background-color: 'some color for no commits' }
.commitscrape-1 { background-color: 'some color for light commits' }
.commitscrape-2 { background-color: 'some color for medium commits' }
.commitscrape-3 { background-color: 'some color for a lot of commits' }

Live Examples

My Website

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL