An awesome telegram bot that summarizes articles for you and your friends.
Report Bug
โข
Request Feature
Are you tired of wading through endless articles filled with redundant information, unclear points, or annoying ads? GemDigest is here to help! This simple yet powerful Telegram bot lets you quickly summarize articles from various websites, giving you a clear and concise summary in just a few sentences.
Whether youโre chatting one-on-one or in a group, GemDigest works seamlessly in the background. We all have that friend who loves to share links to articles and websites, but letโs face itโsometimes thereโs just not enough time to read them all. With GemDigest, simply paste the link into the chat, and the bot will automatically generate a summary for you, saving you time and energy. No extra commands to memorize, no complicated steps involvedโjust share the link, and let the magic happen! ๐งโโ๏ธโจ The bot will recognize the links and reply with a summary, while ignoring any non-link messages to keep your conversations flowing smoothly. ๐ฌ๐
GemDigest uses the power of Googleโs Gemini API, so you donโt need any specialized or high-performance hardware to enjoy this feature. All the heavy lifting is done by Googleโs servers, meaning the bot is fast, reliable, and doesnโt require any expensive infrastructure on your end. ๐ก The best part? The Google Gemini API is completely free (with some limitations), so you wonโt have to spend a cent! ๐ฐ
With GemDigest, say goodbye to lengthy articles and hello to quick, easy-to-read summaries! Save time, stay informed, and focus on what really matters.
This project is entirely written in Python and uses Crawl4AI in conjunction with the Google Gemini API for summarizing articles from the links provided. It also uses the Telegram API for sending the digests to the users.
Here you can find the documentation for the GemDigest bot. This documentation provides detailed information on how to use and the different commands and options available to users. It also includes installation instructions, prerequisites, and other essential details to help you get started with the bot.
You can find all the informations at: Documentation ยป
The GemDigest bot can be installed in several ways:
- Directly using Python with
venv
andpip
- With Docker
- Using Docker Compose
casaos-docker-compose.yml
file provided. This option simplifies the setup, particularly for users of CasaOS who want a streamlined installation process.
Before proceeding with the installation, there are a few prerequisites you will need:
- A Telegram bot token. You can obtain this token by contacting @BotFather on Telegram and following the instructions. This token is essential for enabling the bot's communication through Telegram.
- A Google Gemini API key. This key is necessary for the bot to access and process data using Google Gemini's services. You can obtain the key by creating one through the following link: Google Gemini API Key. Note that there is a free version available with certain limitations, but it should be sufficient for the bot's basic functionalities.
If you plan to run the bot with Python or Docker (outside of CasaOS), you'll need to ensure that both Python and Docker are installed on your system. Python will be used for executing the bot's code and managing dependencies, while Docker allows for containerized deployment, simplifying the environment setup.
For CasaOS users, these additional prerequisites are not required since the platform handles much of the complexity internally, offering a smoother installation experience.
Once you have these prerequisites ready, you can proceed with the installation method that best suits your environment. Whether you prefer running the bot locally with Python, inside a container with Docker, or using CasaOS for an even simpler setup, the flexibility of this bot ensures it can fit your needs.
Based on the prerequisites you have, you can choose the installation method that best suits your needs. Below are the steps for setting up the GemDigest bot using Python, Docker, Docker Compose, or CasaOS. Follow the instructions for the method you prefer to get the bot up and running quickly.
-
Clone the repo
git clone https://github.com/Armaggheddon/GemDigest.git
-
enter the directory
cd GemDigest
-
Create the Venv and Install the dependencies
python3 -m venv env source venv/bin/activate pip install -r requirements.txt
-
Install Playwright and dependencies
pip install --no-cache-dir playwright && playwright install && playwright install-deps
-
Add the API Keys to the environment variables
export TELEGRAM_API_KEY=YOUR_TELEGRAM_API_KEY export GEMINI_API_KEY=YOUR_GEMINI_API_KEY export ADMIN_ID=YOUR_ADMIN_ID
For example:
export TELEGRAM_API_KEY=1234567890:ABCDEF export GEMINI_API_KEY=1234567890:ABCDEF # If you have more than one admin, separate the IDs with a ";" export ADMIN_ID=1234;5678
-
Create a copy of the file
api_keys.env.example
and rename it toapi_keys.env
-
Add the API Keys to the
api_keys.env
fileTELEGRAM_API_KEY=1234567890:ABCDEF GEMINI_API_KEY=1234567890:ABCDEF # If you have more than one admin, separate the IDs with a ";" ADMIN_ID=1234;5678
-
Build the container
docker build -t gem_digest_bot .
-
Start the container
docker run -d --env-file api_keys.env --name gem_digest_bot gem_digest_bot
-
(OPTIONAL) Add blacklist for websites to crawl:
- Edit the file in
extra_configs/website_blacklist.txt
adding your websites to blacklist - Mount the file in the container (use this command instead of the one at step
4
)docker run -d --env-file api_keys.env --name gem_digest_bot -v $(pwd)/extra_configs:/gem_digest_bot/extra_configs gem_digest_bot
- Edit the file in
-
Create a copy of the file
api_keys.env.example
and rename it toapi_keys.env
-
Add the API Keys to the
api_keys.env
fileTELEGRAM_API_KEY=1234567890:ABCDEF GEMINI_API_KEY=1234567890:ABCDEF # If you have more than one admin, separate the IDs with a ";" ADMIN_ID=1234;5678
-
Build the container
docker compose build
-
Start the container
docker compose up -d
-
(OPTIONAL) Add blacklist for websites to crawl by editing the file in
extra_configs/website_blacklist.txt
. Then restart the compose with the following command:docker compose restart
- Add the
BigBearCasaOS
to the store - Download
GemDigest
from the Store - Open the Settings of the app
- Add your
Telegram API Key
,Gemini API Key
and theAdmin ID
(If you have more user add the diferent ID's separated by a";"
)
We assume no responsibility for an improper use of this code and everything related to it. We do not assume any responsibility for damage caused to people and / or objects in the use of the code.
By using this code even in a small part, the developers are declined from any responsibility.It is possible to have more information by viewing the following links: License
To report a bug or to request the implementation of new features, it is strongly recommended to use the ISSUES tool from Github ยป
Here you may already find the answer to the problem you have encountered, in case it has already happened to other people. Otherwise you can report the bugs found.
ATTENTION: To speed up the resolution of problems, it is recommended to answer all the questions present in the request phase in an exhaustive manner.
(Even in the phase of requests for the implementation of new functions, we ask you to better specify the reasons for the request and what final result you want to obtain).
MIT LICENSE
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including...
License Documentation ยป
In the event that the software uses third-party components for its operation,
the individual licenses are indicated in the following section.
Software list:
Software | License owner | License type | Link |
---|---|---|---|
Crawl4AI (Async Version) | unclecode | Apache-2.0 license | here |
Gemini | here | ||
pyTelegramBotAPI | eternnoir | GPL 2.0 license | here |
Copyrright (C) by Brunello Alessandro & Pietrobon Andrea
Released date: 20-10-2024