In the light of Discord's new Widgets v2, I've decided to create a new auto-updating widget that displays my GitHub statistics.
This gets updated every hour with updated statistics and displays information including your total commits, the number of organizations you're in, the number of repositories you've contributed to, and the number of followers you have.
The ideas are endless with this, all this does is give a base for developers who are looking for something like this to build off of.
The Python script is my personal script that I run on GitHub actions on this repository, therefore this won't be an easy drag-and-drop; however, setup is relatively easy.
The image above shows an example of my GitHub stats widget, showcasing how it looks when on a profile.
Setup is pretty straight forward. This requires a classic GitHub token, which is used to list the total number of repositories and commits your account has, and a Discord bot token and application ID to update the statistics every hour.
I would suggest to follow Rohan's Guide, which is what I used to begin to make widgets. The only thing you need from this is how to gain access to the widget editor as well as the config ID of the widget (see the image below for a visualization on where to find it).
I highly suggest to use GitHub actions for this. A premade Widget Sync Workflow has been created already, which can be reused for yourself. You can simply fork the repository, enable workflow actions, setup the secrets, and manually run the action to see whether it's a success or failure.
You can run this anywhere if it has internet connection. This is very lightweight and only requires the requests Python package. Below are a few quick deploy buttons if you're looking for a solution quickly.
Very straight forward. Run the following commands to get started.
git clone https://github.com/lezetho/discord-widget-github
cd discord-widget-github
pip install -r requirements.txtAfter, rename the .env.example to .env, fill out the values, and run the main.py script.
By default, the Python script will run on a 1-hour interval. Running on GitHub actions does the same; however, it will complete the action instead of continuing to run the script.
Please refer to the Contributing guide for more information.
If you encounter any issues along the way, open a GitHub issue and it will be addressed accordingly.
Note
If you would like to report an issue that are related to security concerns, please personally contact me through Discord or email me.
Thanks to Rohan's Guide on making these widgets, I wouldn't know where to begin without this.
This project is licensed under MIT.

