Skip to content

generate GIF animations from your github contribution chart

Notifications You must be signed in to change notification settings

dimaglushkov/contriseg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

contriseg

Contriseg allows anyone to generate animations with their github contributions charts with an extreme ease.

Installation & Launching (without docker)

  1. Install go
  2. Clone or download this repo:
git clone git@github.com:dimaglushkov/contriseg.git
  1. Generate your GitHub Access Token with only read:user privileges
  2. 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)>
  1. Download dependencies, build, and run the application:
go run .

Compressing resulting GIF

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

Creating custom animations

To create a new animation you only need to do two things:

  1. 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.

  1. 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

Releases

No releases published

Packages

No packages published