/auto-contribution

:octocat: Auto generating contributions each week

Primary LanguageJavaScriptMIT LicenseMIT

auto-contribution

Pay GitHub issues GitHub license Gitter

npm version Build Status npm

a node.js module for automatically generating contributions on github without worrying about its movement in the next week. which is only used on Linux OS.

Installation

NPM Installation

npm install auto-contribution
cd ./node_modules/auto-contribution
npm i

Clone Installation

git clone https://github.com/aleen42/auto-contribution.git
cd auto-contribution
npm i

Usage

  1. Create a repository to store generated commits history.

  2. Install dependencies:

    npm i --no-save
  3. Create a json file with IonicaBizau/github-contributions

    Run server.

    npm run server

    And visit the website http://localhost:9000.

    Build up a colorful calendar for yourself, and then generate json data, which should be store into a json file.

  4. Start to update with root mode

    npm run start <repo-url> <coordinates data json file path>
    
    # example: npm start git@github.com:aleen42/contribution.git example.json
    • repo-url under SSH: the repo url should be under SSH protocol like git@github.com:aleen42/contribution.git so that we can run the script in a crontab task.
    • coordinates data json file path: you should put your data generated by IonicaBizau/github-contributions into a json file and give the path of it, and here is an example of json file of aboved result

    If you set up all the things and it should run like this, and waiting for the result cause it will behave so slow when your commitsPerDay is large.

  5. Without any problems of updating remote repository, you can use crontab to set this script in the root mode to automatically update every week like this:

    # su
    # crontab -e
    
    # Edit this file to introduce tasks to be run by cron.
    #
    # Each task to run has to be defined through a single line
    # indicating with different fields when the task will be run
    # and what command to run for the task
    #
    # To define the time you can provide concrete values for
    # minute (m), hour (h), day of month (dom), month (mon),
    # and day of week (dow) or use '*' in these fields (for 'any').#
    # Notice that tasks will be started based on the cron's system
    # daemon's notion of time and timezones.
    #
    # Output of the crontab jobs (including errors) is sent through
    # email to the user the crontab file belongs to (unless redirected).
    #
    # For example, you can run a backup of all your user accounts
    # at 5 a.m every week with:
    # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
    #
    # For more information see the manual pages of crontab(5) and cron(8)
    #
    # m h  dom mon dow   command
    0 0 * * 0 cd /opt/lampp/htdocs/auto-contribution && npm start git@github.com:aleen42/contribution.git example.json

Tests

npm run test

Notice that: the repository generated with test case will be in ./auto-contribution/node_modules/gh-contributions/lib/public/repos/

Released

  • 1.0.0 Initial release
    • 1.1.0 Catch some exceptions
    • 1.1.1 Update readme.md
    • 1.2.0 Add progress to improve interaction
    • 1.2.1 Update readme.md

⛽ How to contribute

Have an idea? Found a bug? See how to contribute.

📜 License

MIT © aleen42