Giter VIP home page Giter VIP logo

old_athos's Introduction

Athos

Athos is a telegram bot that compares prices from diferents stores and notifies the user if the price changes.

About โ“

  • This bot is developed with the idea of being used in a raspberry pi, but it can be deployed in any cloud environment, of course.
  • Usually telegram bots are accessible by everyone using the app. This bot is built to be different. The reason is simple: web scrapping is hard and you have to be considerate with the website. If I allow any user to add products to be tracked, it would almost look like I'm DDosing the stores to get the prices.
  • For this reason, the bot is meant to be replicated and only be used by a small amount of people. That's why it used an authentication mechanism.

Requirements ๐Ÿ› 

  • Python 3.7.
  • Pipenv.
  • SQLite. (Since I use sqlalchemy you could change the DBMS little work.)
  • A Telegram bot API key. (Obtained when you create the bot with botfahter)

Installation ๐Ÿ’ป

  • Clone the repository with git clone in the folder you want to install
  • If you are using a debian based OS can install it running the install.sh script. Using other OS, install the dependencies mentioned above and run pipenv install.
  • Done!

Configuration โš™๏ธ

  • Create .env file (or add env variable) with a variable called: TELEGRAM_API_KEY. This variable should contains the telegram api key obtained when creating the bot.
  • You can (optionally) edit the config files in src/config/constants. The default will check prices every hour (3600 seconds) and wait 1 second between products.
  • Add a user with the script src/database_utils/add_user.py. Like this: python ./src/database_utils/add_user.py johndoe s3cr3t_p455w0rd

Launch ๐Ÿš€

  • Run python ./src/Bot.py
  • Done!
  • If you want it to launch at system startup follow this Stack overflow answer.

How to use ๐Ÿค–

  • First, add a user with the method mentioned in the configuration paragraph.
  • If you added the user correctly, you can log in in telegram using /start s3cr3t_p455w0rd. You just need to do this once. After that, the bot will save your chat ID and will never ask for password again. After that, please DELETE THE PASSWORD MESSAGE. If you don't, every person that access your telegram app will see the password. Also, avoid common password and don't reuse them
  • After that you can add a product with with /add like: /add url productName warningPrice deltaWarning.
    • The url should be the url of the product. Plain and simple.
    • productName is the name you want to product to be identified by.
    • warningPrice is the price you want to be notified if the product reaches that price.
    • deltaWarning is the difference in price you want to be notified by. (If it's 5 the product price should lower 5 or more. Dollars, euros, gbp... whatever.)
  • Use /all to get a list of all the products the bot is following.
  • Use /delete to delete a product using the internal ID showed with /all. Example: /delete 5ec69e815ac457c387e67291

Supported stores ๐Ÿช

Right now Athos only supports 1 store:

The list will of course grow in the future :)

old_athos's People

Contributors

marcosorive avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.