fillll / reddit2telegram Goto Github PK
View Code? Open in Web Editor NEWBot to supply telegram channel with hot Reddit submissions.
Home Page: https://t.me/r_channels
License: MIT License
Bot to supply telegram channel with hot Reddit submissions.
Home Page: https://t.me/r_channels
License: MIT License
Hi,
Thanks for the valuable code. Does it also work for private subreddits? What about with private Telegram channels or groups?
All reddits share similar post types. So the code shouldn't be rewritten for each module.
The process of posing media from a reddit post should be in anoter utils file.
Telepot is no longer mantained and lacks most of the features the bot API introduced during the past 2 years (namely: the ability to send albums). It would be a good idea to move to python-telegram-bot, which seems to be the most up-to-date, robust and popular python bot API library
Since Imgur is about 70% of reddit urls → better to deal with them properly.
It took me a while to get this running without an error but even after I did, whenever I ran docker-compose up reddit2tg
this message gets posted in the channel :
No module named 'channels.unexpected'
However, the output doesnt show any errors:
Recreating reddit2telegram_reddit2tg_1 ...
Recreating reddit2telegram_reddit2tg_1 ... done
Attaching to reddit2telegram_reddit2tg_1
reddit2tg_1 | Sentry is attempting to send 1 pending error messages
reddit2tg_1 | Waiting up to 10 seconds
reddit2tg_1 | Press Ctrl-C to quit
reddit2telegram_reddit2tg_1 exited with code 0
def getGfy(url):
rname = re.findall(r'gfycat.com\/(?:detail\/)?(\w*)', url)
print rname[0]
url = "https://thumbs.gfycat.com/" + rname[0] + "-size_restricted.gif"
return url
Wow, just read it and I have no clue how telepot works or how are you catching the urls maybe its too early and still sleepy, but if you catch the gfycat identifier and add https://thumbs.gfycat.com/ + Identifier + -size_restricted.gif it should give you the smaller version
Hi :)
Is there an easy way to send every comment in the subreddit?
Change format for url
in urls
collection to just post code.
It was: http://redd.it/5e1j2z
, now it is https://redd.it/5e1j2z
. Let's keep just the main part: 5e1j2z
.
Telegram added support for albums of up to 10 items a while ago, this would be better than sending each message from an album as a separate message. Here's the relevant bot API documentation: https://core.telegram.org/bots/api#sendmediagroup
Now it's ~40MB. Which consumes too much memory. Should be much less.
Is there a specific reason why videos are sent as gifs?
It will be much more easy to operate with it using docker.
There should be two containers:
In multiple days the bot just stops sending messages after some time, no particular hour seems to be causing the problem.
To see an example check the post history of this channel where the bot is supposed to post once every two hours.
Happy to provide any info that can help.
Hi!
Thanks for the project, it will be cool to add php related subreddits here.
This is what I mostly read
Thanks again for the project!
Since we have new architecture (#224), that will be awesome to have sample config file to setup the whole bot from scratch.
Sometimes I have saw some super-long text post, which is kind disrupting in the Telegram channel. Is there a way I set the bot to send title and link to that submission, but without the actual content get posted in the channel?
TelegramError: ('MEDIA_CAPTION_TOO_LONG', 400, {'description': 'MEDIA_CAPTION_TOO_LONG', 'error_code': 400, 'ok': False})
subj
Can you update the readme to give us some steps about how to run on own server?
Hi, I wanted to ask how do you scrape the posts from Reddit, consider the future price changes for the API? Do you still use the API or do you scrape the HTML with something Selenium or BeautifulSoup? Thanks in advance.
They should be sent like an non-album imgur image.
(Maybe relates to #22?)
Make it is as a replay to title message.
As the title says, the Zig subreddit is no more.
Andrew closed it because of the recent Reddit stuff.
Reference: https://ziggit.dev/t/the-zig-subreddit-has-closed/679
Thanks @Fillll .
I made the project run every 25 minutes or so, tracking posts from 3 subreddits and posting from both new and hot timelines. But after posting 2-3 posts it starts posts text in channel such as,
13 → 0.13 > 0.06.
13 → 0.13 > 0.07.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.