Simple Python script to dump Telegram logs and generate html/png statistics.
- Python3
- Telegram-cli https://github.com/vysheng/tg/
- Matplotlib http://matplotlib.org/
- pytg https://github.com/luckydonald/pytg/
-
Dependencies libevent-dev, libssl-dev... (TODO)
-
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...
- Start the client with JSON support (Do the registration!)
./bin/telegram-cli --json -P 4458
- Dump dialogs to find correct id for the channel. Copy the id!
$ ./dump.py --dialogs
- 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.
- 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.
- Generate stats
$ ./generate.py test
- View stats at "test" folder