• Stars
    star
    136
  • Rank 262,296 (Top 6 %)
  • Language
    Python
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

More Repositories

1

HoneyChain-MMORPG-Blockchain-based-game-

An MMORPG Blockchain based game
C#
7
star
2

PytorchLightning-BERT

Reusable PytorchLightining implementation of BERT Classifier
Python
4
star
3

distillai

DistillAI is a PyTorch library for knowledge distillation. It is built on top of PyTorch Lightning and provides a simple API for training knowledge distillation models.
Python
3
star
4

neuropulse

A GPU monitoring tool
Python
2
star
5

GraphDB-API-AI2-Project-back-end

HTML
2
star
6

Cocktail-Room

Dart
1
star
7

MoneyApp

An application created with the new Google framework, Flutter, for the management of one's own pockets
Dart
1
star
8

SiteMonitor

An Android App written in Kotlin to Monitor Web pages and to get updates of changes
Kotlin
1
star
9

NLP-Model

Python
1
star
10

web-site

JavaScript
1
star
11

Depixelizer

AI model to remove pixel noise from text images.
Jupyter Notebook
1
star
12

ConfCooperative---Cooperazione-Salute-Hackathon-2019

Progetto Hackathon di ConfCooperative del 23/11/2019("HackApp"). Applicazione per di Cooperazione Salute
Dart
1
star
13

UserManager-NodeJS

A User Manager Project, written in NodeJS to create/read/delete/update users in a mongoDB database.
JavaScript
1
star
14

BERT-NewsCategoryClassification

News Category Classification with BERT based architecture.
Jupyter Notebook
1
star
15

SongLyricsGenerator

Song Lyrics Generator is a Deep Learning model, particularly an RNN model, it is able to generate music lyrics starting from a string input.
1
star
16

Pneumonia-RX-Classifier

Pneumonia RX Classifier, a CNN model created with TensorFlow.
Jupyter Notebook
1
star