Get post from telegram and make ready to repost it to other places (twitter / douban / reddit).
Project description
telepost
Get post from telegram and make ready to repost it to other places (twitter / douban / reddit).
usage
import telepost
import time
import plain_db
import asyncio
existing = plain_db.load('existing')
channel = 'twitter_translate'
post = telepost.getPost(channel, existing, min_time=1, max_time = time.time()) # get the first post outside existing ones
posts = telepost.getPosts(channel, min_time=1, max_time = time.time() - 24 * 10 * 60 * 60) # return a generator
async def run():
# credential file need to contain telegram_api_hash, telegram_api_id and telegram_user_password
post_id = 1392
post_size = 2
filenames = await telepost.getImages(channel, post_id, post_size)
await telepost.exitTelethon()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
r = loop.run_until_complete(run())
loop.close()
how to install
pip3 install telepost
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
telepost-0.0.20.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for telepost-0.0.20-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d3f3853988ac29b10b4233793833b96948f3aa996671ee39e20eef10913857d |
|
MD5 | 5d2951cee361c30c50ce47fa21c602be |
|
BLAKE2b-256 | b5d3a8bff577d8a1a0eec5936a5c27963b6a517940b7dd30f836e8dd8caf1bdb |