Giter Site home page Giter Site logo

shpota / github-activity-generator Goto Github PK

View Code? Open in Web Editor NEW
980.0 18.0 96.0 49 KB

A script that helps generate a rich GitHub Contribution Graph for your account ๐Ÿค–

License: Apache License 2.0

Python 100.00%
python python-script python2 python3 github github-app git gitlab generator generate contribution-graph contributions

github-activity-generator's Introduction

GitHub Activity Generator Gitter build

A script that helps you instantly generate a beautiful GitHub Contributions Graph for the last year.

Before ๐Ÿ˜ ๐Ÿ˜ถ ๐Ÿ˜’

Before

After ๐Ÿ’ช ๐Ÿ˜Œ โค๏ธ ๐Ÿ˜Ž ๐Ÿค˜ ๐Ÿด ๐Ÿ˜‰ ๐Ÿ”ฅ ๐Ÿ’ƒ ๐ŸŽ… ๐ŸŽ† ๐Ÿ’ ๐ŸŽ‰

After

How to use

  1. Create an empty GitHub repository. Do not initialize it.
  2. Download the contribute.py script and execute it passing the link on the created repository
python contribute.py [email protected]:user/repo.git

Now you have a repository with lots of changes in your GitHub account. Note: it takes several minutes for GitHub to reindex your activity.

How it works

The script initializes an empty git repository, creates a text file and starts generating changes to the file for every day within the last year (0-20 commits per day). Once the commits are generated it links the created repository with the remote repository and pushes the changes.

Making contributions private

Note: This script doesn't encourage you to cheat. Cheating is bad. But if anybody is judging your professional skills by the graph at your GitHub profile (which caries no value) they deserve to see a rich graph.

For that matter, you might want to make the generated repository private. It is free on GitHub. Now, you only need to set up your account to show private contributions. This way GitHub users will see that you contributed something, but they won't be able to see what exactly.

Customizations

You can customize how often to commit and how many commits a day to make, etc.

For instance, with the following command, the script will make from 1 to 12 commits a day. It will commit 60% days a year.

python contribute.py --max_commits=12 --frequency=60 [email protected]:user/repo.git

Use --no_weekends option if you don't want to commit on weekends

python contribute.py --no_weekends

If you do not set the --repository argument the script won'tย push the changes. This way you can import the generated repository yourself.

Use --days_before and --days_after to specify how many days before the current date the script should start committing, and how many days after the current date it will keep committing.

python contribute.py --days_before=10 --days_after=15

Run python contribute.py --help to get help.

System requirements

To be able to execute the script you need to have Python and Git installed.

Troubleshooting

I performed the script but my GitHub activity is still the same.

It might take several minutes for GitHub to reindex your activity. Check if the repository has new commits and wait a couple of minutes.

The changes are still not reflected after some time.

Are you using a private repository? If so, enable showing private contributions following this guide.

Still no luck

Make sure the email address you have in GitHub is the same as you have in your local settings. GitHub counts contributions only when they are made using the corresponding email.

Check your local email settings with:

git config --get user.email

If it doesn't match with the one from GitHub reset it with

git config --global user.email "[email protected]"

Create a new repository and rerun the script.

There are errors in the logs of the script.

Maybe you tried to use an existing repository. If so, make sure you are using a new one which is not initialized.

If none of the options helped, open an issue and I will fix it as soon as possible.

github-activity-generator's People

Contributors

21lukeos avatar benjaminhccarr avatar ja2142 avatar manugovindv avatar serpro69 avatar shpota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-activity-generator's Issues

suggestion: support negative values for days_after

Negative values can be reasonably supported for the days_after param if you update the error condition to the following:

if days_after + days_before < 0:
        sys.exit('the absolute value of days_after cannot exceed the value of days before')

When the value is negative, and used with days_before, it allows the param to behave like an "until ___ days before today" value.

Due to GitHub repo visibility constraintsโ€”you can't make forked public repos privateโ€”I didn't want to create a fork and PR myself. I was thinking it might be helpful to offer it up here though. ๐Ÿ˜ƒ

[noob] keep getting: OSError: [Errno 2] No such file or directory

im new to github and wanted to try this.

running ubuntu, installed python via apt and opened terminal inside the main folder containing the python scripts

made an empty repo and typed:
python contribute.py --repository=[email protected]:https://github.com/lettersforword365/testpy.git

am i doing something wrong?

im getting:

Traceback (most recent call last):
File "contribute.py", line 111, in
main()
File "contribute.py", line 28, in main
run(['git', 'init'])
File "contribute.py", line 62, in run
Popen(commands).wait()
File "/usr/lib/python2.7/subprocess.py", line 394, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

No changes

I followed the procedures holistically but still no changes. i made sure all the faq sections were put into consideration.

Cannot find the file (Windows)

Traceback (most recent call last):
File "C:\Users\admin\Desktop\GH_activity\github-activity-generator-main\github-activity-generator-main\contribute.py", line 128, in
main()
File "C:\Users\admin\Desktop\GH_activity\github-activity-generator-main\github-activity-generator-main\contribute.py", line 32, in main
run(['git', 'init', '-b', 'main'])
File "C:\Users\admin\Desktop\GH_activity\github-activity-generator-main\github-activity-generator-main\contribute.py", line 67, in run
Popen(commands).wait()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Cannot find the file
PS C:\Users\admin\Desktop\GH_activity\github-activity-generator-main\github-activity-generator-main>

Some Error

FileNotFoundError: [WinError 3] The system cannot find the path specified: ''

Error creating repo folder when it exists.

If you stop the script and re-run it, this error appears, because the folder of the repo already exists when it tries to create it.

github-activity-generator$ python3 contribute.py --no_weekends  [email protected]:xxxx/yyy.git                                                                             
Traceback (most recent call last):                                                                                                                                                                                 
  File "/home/daf/scripts/github-activity-generator/contribute.py", line 128, in <module>                                                                                                                          
    main()                                                                                                                                                                                                         
  File "/home/daf/scripts/github-activity-generator/contribute.py", line 30, in main                                                                                                                               
    os.mkdir(directory)                                                                                                                                                                                            
FileExistsError: [Errno 17] File exists: 'yyy' 

Unable to specify date range

For example๏ผš I want April 1, 2015 to October 1, 2015 but it will go past October 1, 2015 without stopping and I set --days_before= and --days_after=0,I just want a specific period of time.

Add PRs, Core Reviews, and Issues

Excellent repo, and I've been warning many for years!

However, the activity seems like we only ever commit. That's not corect. We also have PRs code reviews, and issues.

Could we add these? At the very least, we can do PRs and Issues as an API is available for those.

Did this get patched? Date History not working

Did this get patched, the script appears to work

[main a117ef6] "Contribution: 2020-11-28 20:06"
 Date: Sat Nov 28 20:06:18 2020 -0500
 1 file changed, 2 insertions(+)
[main 5245bfc] "Contribution: 2020-12-01 20:00"
 Date: Tue Dec 1 20:00:18 2020 -0500
 1 file changed, 2 insertions(+)
[main dcf0bc1] "Contribution: 2020-12-01 20:01"
 Date: Tue Dec 1 20:01:18 2020 -0500
 1 file changed, 2 insertions(+)
[main 3ec99da] "Contribution: 2020-12-01 20:02"
 Date: Tue Dec 1 20:02:18 2020 -0500
 1 file changed, 2 insertions(+)
Enumerating objects: 4704, done.
Counting objects: 100% (4704/4704), done.
Delta compression using up to 16 threads
Compressing objects: 100% (3135/3135), done.
Writing objects: 100% (4704/4704), 429.40 KiB | 874.00 KiB/s, done.
Total 4704 (delta 1552), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1552/1552), done.
To github.com:BenjaminHCCarr/testing_repo.git
 * [new branch]      main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.

Repository generation completed successfully!

But then I don't see the activity graph populated and the git history itself only shows today:

image

No visible effect on the contribution chart

It has been ~30 mins since I ran the script, but there is no visible effect on the chart at my GitHub profile. However, the contribution count has changed as expected, but no change in graph. I have "Show private contributions" option turned on.

I have 2 questions:

  • does this still work?
  • how long it takes to come in effect?

Add a CI step that executes the script

A new CI step has to be added that will:

  • perform the script passing all the parameters except the repository (it doesn't have to push the changes)
  • verifies that the script generates a git repository and that there are commits

Feature Request: Execution of script with Github Actions

Idea: No need to clone the repo and setup github credentials. Use the github action runner to execute the script.

Github action can take input for:

  1. branch to commit
  2. max_commits
  3. frequency

After all the commits are created, we can push it to our repository within our Github Action runner

Instant crash

Maybe i'm doing something wrong, but i followed each and every step, checked that my git account is fine (email and user) and when i click to open it with python, it instantly closes the window.

fixed

Getting this after I run the script

fatal: 'Repo Name' does not appear to be a git repository
fatal: Could not read from remote repository.

It then says

Please make sure you have the correct access rights
and the repository exists.

Repository generation completed successfully!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.