Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/petrinm/tgstats
Telegram Channel Statistic Generator
https://github.com/petrinm/tgstats
stats telegram telegram-cli
Last synced: about 1 hour ago
JSON representation
Telegram Channel Statistic Generator
- Host: GitHub
- URL: https://github.com/petrinm/tgstats
- Owner: petrinm
- License: mit
- Created: 2016-01-27T10:45:19.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-23T12:01:15.000Z (over 7 years ago)
- Last Synced: 2024-08-01T19:57:14.322Z (3 months ago)
- Topics: stats, telegram, telegram-cli
- Language: Python
- Size: 12.7 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Telegram Channel Statistic Generator
===Simple Python script to dump Telegram logs and generate html/png statistics.
Dependencies
---
* Python3
* Telegram-cli https://github.com/vysheng/tg/
* Matplotlib http://matplotlib.org/
* pytg https://github.com/luckydonald/pytg/Getting started
---0) Dependencies libevent-dev, libssl-dev... (TODO)
1) 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...
```2) Start the client with JSON support (Do the registration!)
```
./bin/telegram-cli --json -P 4458
```3) Dump dialogs to find correct id for the channel. Copy the id!
```
$ ./dump.py --dialogs
```4) 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 useNote: When executed the first time initdb is required.
```
$ ./dump.py test --initdb --id
```
Kill the script with CTRL+C when it starts to complain about empty responses.5) 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.6) Generate stats
```
$ ./generate.py test
```7) View stats at "test" folder