An open API service indexing awesome lists of open source software.

https://github.com/armaggheddon/gemdigest

Simplify your reads, amplify your time! 📚✨ GemDigest is a Telegram bot that summarizes articles from any website into bite-sized nuggets, saving you time and energy for what matters most. 📱👋
https://github.com/armaggheddon/gemdigest

gemini-api pytelegrambotapi python telegram-bot

Last synced: about 2 months ago
JSON representation

Simplify your reads, amplify your time! 📚✨ GemDigest is a Telegram bot that summarizes articles from any website into bite-sized nuggets, saving you time and energy for what matters most. 📱👋

Awesome Lists containing this project

README

          











GemDigest

















An awesome telegram bot that summarizes articles for you and your friends.


Report Bug

Request Feature

---




📔 Introduction


Introducing GemDigest: Your Personal Article Summarizer for Telegram! 📜✨



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. 💬🔗






Powered by Google Gemini 🚀





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.





🛠 Built in



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.





Python
Google Gemini API
Crawl4AI
Telegram API




📚 Documentation



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 »



🧰 Prerequisites



The GemDigest bot can be installed in several ways:


  • Directly using Python with venv and pip

  • With Docker

  • Using Docker Compose


Additionally, if you are using CasaOS, you can easily install the precompiled build by using the 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.



⚙️ How to Start



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.

Python

1. Clone the repo

```bash
git clone https://github.com/Armaggheddon/GemDigest.git
```

2. enter the directory

```bash
cd GemDigest
```

3. Create the Venv and Install the dependencies

```bash
python3 -m venv env
source venv/bin/activate
pip install -r requirements.txt
```

4. Install Playwright and dependencies

```bash
pip install --no-cache-dir playwright && playwright install && playwright install-deps
```

5. Add the API Keys to the environment variables

```bash
export TELEGRAM_API_KEY=YOUR_TELEGRAM_API_KEY
export GEMINI_API_KEY=YOUR_GEMINI_API_KEY
export ADMIN_ID=YOUR_ADMIN_ID
```

For example:

```bash
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
```

Docker

1. Create a copy of the file `api_keys.env.example` and rename it to `api_keys.env`

2. Add the API Keys to the `api_keys.env` file

```bash
TELEGRAM_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
```

3. Build the container

```bash
docker build -t gem_digest_bot .
```

4. Start the container

```bash
docker run -d --env-file api_keys.env --name gem_digest_bot gem_digest_bot
```

5. **(OPTIONAL)** Add blacklist for websites to crawl:
- Edit the file in [`extra_configs/website_blacklist.txt`](../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`)
```bash
docker run -d --env-file api_keys.env --name gem_digest_bot -v $(pwd)/extra_configs:/gem_digest_bot/extra_configs gem_digest_bot
```

Docker Compose

1. Create a copy of the file `api_keys.env.example` and rename it to `api_keys.env`

2. Add the API Keys to the `api_keys.env` file

```bash
TELEGRAM_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
```

3. Build the container

```bash
docker compose build
```

4. Start the container

```bash
docker compose up -d
```

5. **(OPTIONAL)** Add blacklist for websites to crawl by editing the file in [`extra_configs/website_blacklist.txt`](../extra_configs/website_blacklist.txt). Then restart the compose with the following command:
```bash
docker compose restart
```

CasaOS



  • 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 the Admin ID (If you have more user add the diferent ID's separated by a ";")

---



📮 Responsible Disclosure



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



🐛 Bug and Feature



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).





---



🔍 License


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 »





📌 Third Party Licenses

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
Google

here


pyTelegramBotAPI
eternnoir
GPL 2.0 license
here

---
> *

Copyrright (C) by Brunello Alessandro & Pietrobon Andrea
Released date: 20-10-2024*