I
I
Ilya Rozum2019-03-04 21:32:50
Python
Ilya Rozum, 2019-03-04 21:32:50

Parsing botTelegram?

Hello, there is a telegram bot, tell me how it can be implemented, for example, a person writes the size and brand of a thing to the bot and he gives him a site where he can order cheaper, while the bot knows which sites he needs to view

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrew Nodermann, 2019-03-04
@klad_man

1. You need to add a catalog of things, it’s better to use a database for this, take mongo , it knows how to work well with json format, telegram sends and receives data in json, so it will be easy for you to work with data
2. Decide on a data structure, for example:

{
  "items": [
    {
      "name": "shmotka 1",
      "size": [
        37,
        38,
        45
      ],
      "brand": "nike",
      "website": "https://amazon.com/"
    },
    {
      "name": "shmotka 2",
      "size": [
        39,
        42
      ],
      "brand": "zara",
      "website": "https://market.yandex.ru/"
    }
  ]
}

3. Throw this data into your database
4. Try to write a simple request to search for things by size
5. If there are difficulties, write in response to a comment

I
Ivan Shumov, 2019-03-04
@inoise

You receive a message from a person, run it with an analyzer, search in the database, send a message - Profit)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question