Skip to content

petrinm/tgstats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Channel Statistic Generator

Simple Python script to dump Telegram logs and generate html/png statistics.

Dependencies

Getting started

  1. Dependencies libevent-dev, libssl-dev... (TODO)

  2. Download and compile telegram-cli. Use the test branch!

git clone --recursive -b test https://github.com/vysheng/tg.git tg-test && cd tg-test
./configure --disable-liblua
make

1½) Install Python dependencies.. etc

sudo apt-get install python3-matplotlib 
pip3 install pytg
etc...
  1. Start the client with JSON support (Do the registration!)
./bin/telegram-cli --json -P 4458
  1. Dump dialogs to find correct id for the channel. Copy the id!
$ ./dump.py --dialogs
  1. Start dumping messages.

If the dump script is terminated it stores it's current offset to "name_offset" file and the script tries always to continue from the last position. Remove the offset file when you need to start from the beginning or use

Note: When executed the first time initdb is required.

$ ./dump.py test --initdb --id <your id>

Kill the script with CTRL+C when it starts to complain about empty responses.

  1. To update or continue dumping without reseting request index
$ ./dump.py test [--continue]

Kill the scripts with CTRL+C after message id collisions start to occur.

  1. Generate stats
$ ./generate.py test
  1. View stats at "test" folder

About

Telegram Channel Statistic Generator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages