A bot that crawls Github for projects without any license, and asks the owner to add a license.
Github is full of "open source" project that carry no explicit license. This bot will create an issue in repositories that are missing a license.
Generally speaking, the absence of a license means that the default copyright laws apply. This means that you retain all rights to your source code and that nobody else may reproduce, distribute, or create derivative works from your work. This might not be what you intend.
Source: https://help.github.com/articles/open-source-licensing/
The bot searches Github for repositories that have some stars (although the star restriction is a bit wonky). For the returned repos, it will check to see existence of any license information. If it's missing, it will create an issue in the repo. Simple!
All repositories that are processed (skipped or issue created) are saved in a sqlite3 database. This is done to prevent double scanning the same repository.
Currently I'm running this bot on a 1GB DigitalOcean instance (yes, that's an affiliate link. Use that to get free VPS for 2 months). The bot is low of resources and uses a couple dozen MB of RAM.
- Python 2.7
- pip
- sqlite3
Create a file called config.py
that looks like config_example.py
. Fill in the necessary values.
For Github config:
Then, to run the bot:
$ pip install -r requirements.txt
$ python bot.py
This only runs the bot once, meaning only one search. To make it look (think while True: search and stuff
), you need to write your own wrapper. I'm not including mine to prevent misuse of Github's API.
From the project root:
$ pip install -r requirements.txt
$ python -m unittest discover test