diff options
| author | la-ninpre <leobrekalini@gmail.com> | 2020-11-17 14:24:57 +0300 |
|---|---|---|
| committer | la-ninpre <leobrekalini@gmail.com> | 2020-11-17 14:28:10 +0300 |
| commit | 4bb3aff513740c29604a5d50fa16145746333645 (patch) | |
| tree | 4b2af42a5d1455d40683d7647b487bd5639b4ace | |
| parent | 2d26d28c8f891bae27bf075b443b1e82185e4a37 (diff) | |
| download | tg2md-4bb3aff513740c29604a5d50fa16145746333645.tar.gz tg2md-4bb3aff513740c29604a5d50fa16145746333645.zip | |
add readme
Some raw and crappy documentation.
| -rw-r--r-- | README.md | 43 | ||||
| -rw-r--r-- | docs/tg-export.png | bin | 0 -> 38418 bytes | |||
| -rw-r--r-- | parse.py | 7 |
3 files changed, 43 insertions, 7 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..2eb604e --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# telegram2md + +This script parses output from Telegram channel and converts each post to +jekyll-applicable post in markdown. + +Telegram Desktop creates JSON file, as well as different directories containing +multimedia, photos, etc. This script creates new directory and populates it with +formatted posts ready to publish. + +## basic usage + +Firstly you need to export your channel history from Telegram Desktop app. +This could be done from three dots menu. Then popup menu appears, where +you can choose what data you want to export. The script currently supports +only photos, voice messages and audio files. + + + +In format menu you should specify 'Machine-readable JSON' file and then +locate to directory of your desire. + +To convert your posts to markdown files you need to copy `parse.py` file into +your export folder and run it there. + +```console +$ cp parse.py /path/to/export/dir +$ cd /path/to/export/dir +$ python parse.py +``` + +Currently there's no way to change name of ouput folder other than directly +editing the script. By default it's creating directory `formatted_posts` with +markdown files in there. + +Also if your jekyll directory storing media files in folders other than `photos` +and `files`, you should change `photo_dir` and `media_dir` variables. + +## todo's + +- replies +- single/muliple tags +- forwarded posts +- custom post header diff --git a/docs/tg-export.png b/docs/tg-export.png Binary files differnew file mode 100644 index 0000000..94b45a3 --- /dev/null +++ b/docs/tg-export.png @@ -1,12 +1,5 @@ #!/usr/bin/env python -# This script parses output from Telegram channel and converts each post to -# jekyll-applicable post in markdown. -# -# Telegram creates result.json file, as well as different directories containing -# multimedia, photos, etc. This script creates new directory and populates it -# with formatted posts ready to publish. -# # TODO summary: # - replies # - single/muliple tags |
