kadircet / cownotifier Goto Github PK
View Code? Open in Web Editor NEWNews groups notifications with Telegram
Home Page: https://telegram.me/cownotifbot
License: GNU General Public License v3.0
News groups notifications with Telegram
Home Page: https://telegram.me/cownotifbot
License: GNU General Public License v3.0
Currently we are writing the timestamp received from Discourse directly to the message header. This timestamp is in UTC and may cause confusion/problems when used in different timezones.
We need to be able to adjust the timezone (possibly via conf.ini
file) and create the Date
field in the message header in this timezone. Also we should make it (more) human readable, since the timestamp format is a bit hard to read.
Currently we convert every entity which has links in a post to an <a>
tag. If there is one image link in the post this works okay with the Telegram's link preview functionality. But when there is more than one link in the post only the first link is previewed.
Instead of converting everything to <a>
tags, we want to send the images/videos/documents as different messages. It would be best if the images are sent as an album (in case a post has more than one image)
There are also TODO
s about attachments scattered through the code relevant to this issue.
+1 messages from hundreds of students are annoying.
A content filter will help a lot.
It would be nice if header section contained a url to the main post, so that you can directly go to the reply page.
Though it might mess up with the previews, as telegram usually puts a preview for only the first link, so it might make sense to put that URL as a footer.
On the other hand, discourse might be doing a more clever job on providing previews for posts(select the image with most clicks etc.) so we might wanna experiment a little bit first.
I just realized that there are 2 "ses" categories, namely "ses" and "social/ses" and it is impossible to subscribe to the regular "ses". COWNotifier automatically assumes "ses" is "social/ses" (I believe due to lower id)
ses: https://cow.ceng.metu.edu.tr/c/ses/182
social/ses: https://cow.ceng.metu.edu.tr/c/social/ses/35
For telegram to render <a>
tags correctly, href
attribute of the tag should be an absolute url. Discrourse, however, sometimes puts relative url to the href
attribute causing the text to be rendered as plain text instead of a link.
To fix this, we need to check the links to see if they are absolute links. If they are not, we then should convert them to absolute ones by prepending them with the news.host
value from the config.
Currently we check if the emoji_codepoints.py
exists while still doing the imports and if it doesn't exists first we generate it and then continue with the imports. We need to come up with a better approach to handle this emoji lookup file. Maybe we can convert it to a json file and read it just like the config.
Currently we just strip down the HTML received from Discourse (except tags) and send the telegram message with no formatting. We also directly put the image links into the message body, and since they are usually quite long links they take valuable character space and look unpleasant. Discourse sends emojis as images also, this causes the bot to convert all the emojis into links and the telegram's link preview feature results in unwanted behavior.
To solve these issues, we can use the telegram's limited html tag support. Most of the tags can be mapped to the tags which telegram supports (e.g. <h1> to <b>). Telegram also support tags, these can be used for links (including images). Telegram supports emojis natively so we just need to replace the entire emoji tag with appropriate unicode bytes.
Currently when a topic is closed system
user automatically replies to the topic with the following message:
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
Since this message is not useful in the context of COWNotifier (overall usefullness is also debatable), we should not forward it to the users.
What does it do? Please add Readme.MD file :P
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.