Giter VIP home page Giter VIP logo

avito-parser's Introduction

Avito Parser

A bot that allows you to receive notifications about new ads on Avito. Written in Python using the Aiogram library ๐Ÿ

๐Ÿƒ How do I run it?

1. Clone this repository ๐Ÿš€

git clone https://github.com/t3m8ch/aiogram-template.git
cd aiogram-template

2. Copy *-example.env to .env ๐Ÿ”„

cp minimal-example.env .env
# OR
cp full-example.env .env

3. Edit the .env file using a text editor ๐Ÿ“‹

If you use webhooks and use the minimal example, you need to add the TG_WEBHOOK_HOST parameter, which specifies the host to which Telegram will send requests.

Default values:

TG_SKIP_UPDATES=NO
TG_WEBHOOK_PATH=/bot

WEBAPP_HOST=localhost
WEBAPP_PORT=3000

LOG_LEVEL=INFO

DB_URL="postgresql+asyncpg://localhost/avito_parser"

REDIS_PORT=6379

CHECK_INTERVAL_SECONDS=180

Valid values of TG_SKIP_UPDATES: YES/Y/TRUE/1 or NO/N/FALSE/0

Webhooks can be used without setting SSL options if you use Certbot certificates or a certificate purchased from a Certificate Authority or if you use Ngrok.

If you want to use Redis to store the states, specify the REDIS_HOST parameter. Otherwise MemoryStorage will be used.

4. Install the necessary dependencies with the help of poetry ๐Ÿ”ฝ

poetry install

5. Copy alembic.example.ini to alembic.ini ๐Ÿ”„

cp alembic.example.ini alembic.ini

6. If you changed the default value of DB_URL, change it in alembic.ini as well โ—

sqlalchemy.url = insert://connection:string@to/postgres_here

7. Create a database in Postgresql ๐ŸŽฉ

psql -c "create database avito_parser"

8. Do the migrations ๐Ÿฆ

poetry run alembic upgrade head

9. Now you can run the bot! ๐ŸŽ‰

poetry run python3 bot

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.