Giter VIP home page Giter VIP logo

gitadon's Introduction

Gitadon

Project Image

Overview

This is a Python bot that monitors your GitHub repositories for new commits and posts updates to Mastodon. The bot periodically checks for new commits in your repositories and, if a new commit is detected, it sends a post to your Mastodon account with a link to the commit on GitHub.

How It Works

The bot uses the GitHub API to fetch the latest commit SHA for each repository and compares it with the last known commit SHA. If a new commit is found, it generates a post with the commit URL and sends it to your Mastodon account using the Mastodon API.

Installation

  1. Make sure you have Python installed on your system. If not, download and install Python from the official website: https://www.python.org/downloads/

  2. Clone this repository to your local machine:

git clone https://github.com/your-github-username/github-to-mastodon-bot.git
cd github-to-mastodon-bot
  1. Install the required libraries using pip:
pip install requests
pip install Mastodon.py
  1. Configure the bot:

Open github_to_mastodon_bot.py in a text editor.

Replace the placeholders with your actual GitHub username and access token, as well as your Mastodon instance URL and access token.

Run the bot:

python github_to_mastodon_bot.py

The bot will now start monitoring your GitHub repositories and posting updates to Mastodon when new commits are detected.



๐Ÿ”‘ How to Get GitHub Access Token ๐Ÿ”‘

To use this bot, you need a GitHub Personal Access Token to authenticate API requests. Follow these steps to get your access token:


  1. Log in to your GitHub account.

  2. Go to your GitHub settings by clicking on your profile picture in the top right corner and selecting "Settings."

  3. In the left sidebar, click on "Developer settings."

  4. From the "Developer settings" menu, click on "Personal access tokens."

  5. Click the "Generate new token" button.

  6. Give your token a name, select the desired scopes (usually "repo" is enough for this bot), and click "Generate token."

  7. Copy the generated token and use it as your GITHUB_ACCESS_TOKEN in the bot's configuration.


๐Ÿ”‘ How to Get Mastodon Access Token ๐Ÿ”‘:

To post updates to Mastodon, you need an access token for your Mastodon account. Here's how you can obtain it:

  1. Log in to your Mastodon account on your instance.

  2. Go to "Preferences" > "Development" > "Your applications" (or something similar depending on your instance).

  3. Click on "New application" or "Create an application."

  4. Fill in the required fields. For the redirect URI, you can use any valid URI (e.g., "https://example.com").

  5. Click "Submit" or "Create application."

  6. The access token will be generated. Copy the access token and use it as your MASTODON_ACCESS_TOKEN in the bot's configuration.

gitadon's People

Contributors

brandon-roff avatar

Watchers

 avatar

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.