Giter Site home page Giter Site logo

wokawoka / amazonoffers-telegrambot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samirsalman/amazonoffers-telegrambot

0.0 0.0 0.0 12.93 MB

This project is a Telegram Bot connected to a Telegram Channel that check Amazon offers and send them to your Channel.

Shell 0.01% Python 99.99%

amazonoffers-telegrambot's Introduction

Amazon Offers Telegram Bot

logo

This project is a Telegram Bot connected to a Telegram Channel that check Amazon offers and send them to your Channel.

Requirements

SCRIPT INSTALLER

Now you can run the script.sh file from the terminal to install all dependencies, included paapi5 package. Open a terminal in the working directory, then type bash script.sh and launch the command.

MANUAL INSTALLER

If you used the script.sh method you can skip the following step.

In order to use this bot you must complete the following steps:

pip3 install -r requirements.txt
cd paapi5-python-sdk
python3 setup.py build
python3 setup.py install
cd ..

Project Structure

The project is organized like follow:

  • bot.py

    • Contains the bot start code
  • consts.py

    • HERE YOU MUST PUT YOUR TELEGRAM API KEYS AND PARAMETERS AND YOUR AMAZON API KEYS AND PARAMETERS
    • THE CHANNEL_NAME SHOULD START WITH @ (for example @MyChannelName)
  • amazon_api.py

    • Contain amazon api function to search products
  • response_parser.py

    • Util functions that parse amazon api response
  • create_messages

    • message creation functions

How it works

The bot is running in a while loop, you can define your favorite parameters for:

  • Hours of activity
  • Pause time between messages
  • Amazon Search Categories
  • Search Keywords

The bot is active if the time is between MIN_HOUR and MAX_HOUR (you can deactivate it during the night for example) , you can define these parameters in the code.

The do a break for defined PAUSE_MINUTE after sent a message.

You can also edit message body in create_messages.py.

The bot make all http requests to Amazon API at start, save a list of all results in RAM and as long as there are items in results list it:

  1. SEND OFFER MESSAGE
  2. PAUSE FOR PAUSE_MINUTES
  3. SEND ANOTHER MESSAGE

for all the activity time. When all results have been sent, it restart his loop.

NOW YOU CAN SEARCH OVER MULTIPLE CATEGORIES : in bot.py you need to specify your categories and a list of keywords for each category. The corresponding variable is categories, it accept a dictionary like:

{
  "1_CATEGORY_NAME":[LIST OF KEYWORD],
  "2_CATEGORY_NAME":[LIST OF KEYWORD]
}

Usage

After cloning the repository, define all parameters in the code, install all packages and then start bot with command: python bot.py or python3 bot.py

Support

If you need support for the installation and usage of the library you can write to:

In order to mantain and improve the library consider to contribute:

paypal

Message Structure

image

This is a generated telegram channel message example, you can edit the message structure on create_messages.py code.

Author

Samir Salman

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.