Skip to main content

Library for scrap telegram chats

Project description

lib_telegram_scrap

lib_telegram_scrap это библиотека для сбора информации из чатов

Установка из PyPI

pip install lib_telegram_scrap

Использование репозитория GitHub

git clone https://github.com/YuranIgnatenko/lib_telegram_scrap.git
cd lib_telegram_scrap
pip install .

Пример использования

from lib_telegram_scrap.scrapper import Scraper
import asyncio
import configparser

config = configparser.ConfigParser()
config.read('config.ini')

API_ID = config['Telegram']['api_id']
API_HASH = config['Telegram']['api_hash']
COUNT_LAST_MESSAGES = config['Channel']['count_last_messages']
URL_CHANNEL = config['Channel']['url']

async def main():
	scraper = Scraper(api_id=API_ID, api_hash=API_HASH)

	messages = await scraper.get_last_messages(URL_CHANNEL, COUNT_LAST_MESSAGES)
	
	# Process messages
	for message in messages:
		print(f"Message: {message.message}")
		print(f"Date: {message.date}")
		print("---")

	await scraper.close()

if __name__ == "__main__":
	asyncio.run(main())

If first using, then enter console

phone number: +7xxxxxxxxx
received code from telegram: xxxxx
*your 2-password

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lib_telegram_scrap-1.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lib_telegram_scrap-1.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file lib_telegram_scrap-1.1.tar.gz.

File metadata

  • Download URL: lib_telegram_scrap-1.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for lib_telegram_scrap-1.1.tar.gz
Algorithm Hash digest
SHA256 de4230abd81318a7b34b6ad36f2ab46cb4b4a53127a54729b062803998f35ca6
MD5 dec21e928de87f71b18daeb77af2afa1
BLAKE2b-256 335d22be41f05aa7ce72fc862e02722febb6d928dc025b009eba6b951c101076

See more details on using hashes here.

File details

Details for the file lib_telegram_scrap-1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for lib_telegram_scrap-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1cd1222672ea0865fefced75187a5bdce287aeabe04db524672a2ccccd5f8068
MD5 f1309e5226299875a67c200521446979
BLAKE2b-256 e36956288f1e49a7a8dbe68b4e402b1374ef79cf88d9661c66db22d95afd2d59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page