Skip to content

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. ๐Ÿ“ฑ๐Ÿ‘‹

License

Notifications You must be signed in to change notification settings

Armaggheddon/GemDigest

Repository files navigation




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

    git clone https://github.com/Armaggheddon/GemDigest.git
  2. enter the directory

    cd GemDigest
  3. Create the Venv and Install the dependencies

    python3 -m venv env
    source venv/bin/activate
    pip install -r requirements.txt
  4. Install Playwright and dependencies

    pip install --no-cache-dir playwright && playwright install && playwright install-deps
  5. 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

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

    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

    docker build -t gem_digest_bot .
  4. Start the container

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

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

    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

    docker compose build
  4. Start the container

    docker compose up -d
  5. (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

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

About

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. ๐Ÿ“ฑ๐Ÿ‘‹

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published