Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manthanank/blogs-to-telegram
Blogs To Telegram
https://github.com/manthanank/blogs-to-telegram
api blogs devto github-actions telegram telegram-bot telegram-bot-api
Last synced: about 6 hours ago
JSON representation
Blogs To Telegram
- Host: GitHub
- URL: https://github.com/manthanank/blogs-to-telegram
- Owner: manthanank
- License: mit
- Created: 2024-08-01T17:48:40.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T09:19:41.000Z (15 days ago)
- Last Synced: 2024-10-25T06:45:17.907Z (14 days ago)
- Topics: api, blogs, devto, github-actions, telegram, telegram-bot, telegram-bot-api
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Blogs To Telegram
This GitHub Actions workflow automatically posts new articles from your DEV.to account to a specified Telegram chat. The workflow runs every hour and checks for new articles. If a new article is found, it sends a message to the Telegram chat with the article's title and URL.
## Setup
1. **Fork the repository**: Fork this repository to your own GitHub account.
2. **Add Secrets**: Add the following secrets to your GitHub repository:
- `DEVTO_API_KEY`: Your DEV.to API key.
- `TELEGRAM_BOT_TOKEN`: Your Telegram bot token.
- `TELEGRAM_CHAT_ID`: The chat ID where you want to post the messages.3. **Configure the Workflow**: The workflow is defined in `.github/workflows/post-to-telegram.yml`. It is scheduled to run every hour but can also be triggered manually.
## How It Works
1. **Fetch DEV.to Articles**: The workflow fetches the latest published articles from your DEV.to account using the DEV.to API.
2. **Check for New Articles**: It compares the ID of the latest article with the ID stored in `last_posted_article_id.txt`. If they are different, it means a new article has been posted.
3. **Post to Telegram**: If a new article is found, the workflow sends a message to the specified Telegram chat with the article's title and URL.
4. **Update Last Posted Article ID**: The workflow updates the `last_posted_article_id.txt` file in the repository to keep track of the last posted article.
## Running the Workflow
The workflow runs automatically every hour. You can also trigger it manually from the Actions tab in your GitHub repository.
## Example
Here is an example of the message that will be posted to Telegram:
New DEV.to article published: ["How to Automate Your Workflow with GitHub Actions"](https://dev.to/yourusername/how-to-automate-your-workflow-with-github-actions)
## Contributing
Feel free to contribute to this project and help make it better. You can create a pull request with your changes or open an issue if you have any questions or suggestions.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.