Skip to content

abarichello/reddit-to-telegram

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reddit-to-telegram

This script will watch the new content on a subreddit and post to a Telegram channel.

This fork is modified so that the bot posts one piece of content from the Hot session of the subreddit every hour at exactly 00 minutes.

TODO: Send image/gif directly instead of only the link.

Config

  • Create a praw.ini file:
[default]
client_id: <client id>
client_secret: <client secret>
username: <reddit user name>
password: <reddit user password>
  • Set the following env vars:

    • SUBREDDIT - subreddit name
    • TOKEN - Telegram bot token
    • CHANNEL - Telegram chat name (the bot has to be added as Administrator)
  • Run python3 telegram_poster.py

Notes

The last sent submission id is being stored in last_submission.id file, so if this file exists the bot will skip all submissions in the previous ones until this ID is found - or a new submission has been posted appears (this is determined by UTC timestamp of the submission and bot start time)

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%