/reddit2telegram

Bot to supply telegram channel with hot reddit submissions

Primary LanguagePythonMIT LicenseMIT

reddit2telegram

Hi there!

These bots just send latest hot submissions from subreddit /r/%subreddit% to telegram channel @r_%subreddit% hourly. For example /r/gifs@r_gifs.

If you want to obtain your own channel for /r/%subreddit%:

  1. Create new public telegram channel @r_%subreddit%.
  2. Add @reddit2telegram_bot as administrator to this channel.
  3. Make a pull request to this repo with new script to make posts (use /channels/r_funnny/app.py as draft).
  4. Then I will make it alive :)
  5. For any questions do not hesitate to contact me in this group or on reddit.

Currently alive channels

Subreddit Telegram Channel Periodicity
/r/gifs @r_gifs 1 hour
/r/jokes @r_jokes 2 hours
/r/funny @r_funny 1 hour
Some data related subreddits. Full list. @DataScientology 1 hour
/r/asiangirlsbeingcute @asiangirlsbeingcute 1 hour
/r/behindthegifs @r_behindthegifs 1 day
Some python related subreddits. Full list. @pythondaily 1 hour
/r/unexpected @r_unexpected 30 mins
Some subreddits about history. List. @RedditHistory 4 hours
/r/bitcoin @r_bitcoin 1 hour
/r/pics @r_pics_redux 1 hour
/r/politics and /r/news @news756 1 hour
Cat related. List. @RedditCats ~1 hour
/r/TIL @r_TIL 8 hours
/r/awwnime @r_awwnime 1 hour
/r/mylittlepony @r_mlp 1 hour
/r/Showerthoughts/ @r_Showerthoughts 1 hour
/r/HighQualityGifs/ @r_HighQualityGifs 1 hour
/r/dankmemes/ @r_dankmemes 1 hour
/r/me_irl/ @r_me_irl 1 hour
/r/PoliticalHumor/ @PoliticalHumor 1 hour
/r/OldSchoolCool/ @OldSchoolCool 3 hours
/r/food/ @reddit_food 3 hours
Some gifs. @rddit 3 hours
/r/denpasong/ and /r/denpa/ @denpasong 1 hour
/r/movies/, /r/CineShots/, and /r/MoviePosterPorn/ @r_movies 1 hour
BeautifulFemales from list. @r_gentlemanboners 2 hours
Best from /r/all. @reddit_all 3 hours
/r/AskReddit @r_AskReddit 1 hour
/r/changemyview @r_changemyview 1 hour
/r/explainlikeimfive @r_explainmelikeimfive 1 hour
/r/hmmmgifs and /r/hmmm/ @just_hmmm ½ hour
/r/ProgrammerHumor @programmer_humor 1 hour
/r/cryptocurrency @r_cryptocurrency 2 hours
/r/foodporn @dailyfoodporn 1 hour
/r/overwatch @r_overwatch 1 hour
/r/cryptocurrency @r_cryptocurrency 2 hours
/r/pantsu @r_pantsu 1 hour
/r/listentothis @r_listentothis 1 hour
/r/ramen @r_ramen 1 hour
/r/freefolk @r_freefolk 1 hour
/r/fantheories @r_fantheories 1 hour
/r/slimerancher @r_slimerancher 1 hour
/r/googleplaydeals @r_googleplaydeals 1 hour
/r/Tinder @rtinder 1 hour
/r/Indiancelebs @Indiancelebs 1 hour
/r/pcmasterrace @r_pcmasterrace 1 hour
... be the next one ...

If you appreciate it




Running it

Easiest way is to do it with docker. It will set up the mongo database dependency.

Config

Make your copy of prod.yml and imgur.yml.

cp prod.yml.example prod.yml
cp imgur.yml.example imgur.yml

Now edit the files, replacing the values with real ones.

Note: When using docker, db_host: "mongo" must be set in prod.yml.

Launching

docker-compose up -d
  • -d is detach. Leave out to see output.

Changing code

docker-compose up reddit2tg --build

Assuming you already started mongo in detached mode (above). This rebuilds the reddit2tg image and launches it.

  • reddit2tg: the service name of the bot part (as opposed to the database mongo)
  • --build if you changed code and need a new build version

Note

The reddit2tg docker image is terminating pretty quickly as the python script was made for a cron script. Currently you have to either start the container over and over again (docker-compose up -d reddit2tg) or finally write a cron like script in the docker container. (Send a PR please!)