Contriseg allows anyone to generate animations with their github contributions charts with an extreme ease.
- Install
go
- Clone or download this repo:
git clone [email protected]:dimaglushkov/contriseg.git
- Generate your GitHub Access Token with only
read:user
privileges - Create your
.env
file from the.env.example
with the following content:
GITHUB_USERNAME=<target user>
GITHUB_TOKEN=<previously generated token>
TARGET_LOCATION=<output file location>
ANIMATION=<animation type ()predefined: bfs, cbc, move)>
- Download dependencies, build, and run the application
go mod download
go build -o main
./main
Since a generated GIF could be big and take too long to be downloaded, you can compress it using amazing gifsicle
.
To do that just run
./bin/compress.sh
To create a new animation you only need to do two things:
- Implement function of type
type Iterator func(cal internal.Calendar) []internal.Calendar
which should return a list of continuously changing Calendar
(it's basically frames for Calendar).
Check out anim.go
to see predefined animations.
- After animation is completed, insert it's alias and name to iterationsMap
var animationsMap = map[string]AnimationIterator{
"bfs": CalendarBFSIterations,
"move": CalendarMoveColLeftIterations,
"cbc": CalendarColByColIterations,
"your_alias": YourAnimationFunction
}
That's it, now you can use your own animation by just editing .env
file and changing ANIMATION
value to the alias of the recently created animation