Git Product home page Git Product logo

telegram_scraper's Introduction

Python Client to scrape messages, save to MySQL DB and serve to get requests.

Setup:

  1. Python (3.10)
    1. Pip install telethon==1.28.5, mysql-connector-python==8.0.33 and Flask==1.0.2 (All written in the requirement.txt file)
  2. You'll need MySQL Server
    1. Get the username, password, hostname and port to the database_settings.json file
  3. Activated Telegram account
    1. After activation go to https://my.telegram.org/ and menage apps
    2. Put your phone number, api id and api hash in the credentials.json file

Example for credentials.json file:

{
  "clients": [
      {
        "phone_number": "+972 123 456 789",
        "api_id": 12345678,
        "api_hash": "1234567890abcdef1234567890abcdef"
      }
    ]
}

Run:

  1. You'll need to run the telegram scraper every once in a while
  2. Run the server
    1. Example request: http://localhost:5000/data?from_date=2023-06-20&to_date=2023-06-30&chat_name=cool chat

telegram_scraper's People

Contributors

yonlif avatar netashefer avatar

Watchers

 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.