Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

tracking(Notifications): add RSS feed support #53

Open
JABirchall opened this issue Jul 11, 2021 · 7 comments
Open

tracking(Notifications): add RSS feed support #53

JABirchall opened this issue Jul 11, 2021 · 7 comments

Comments

@JABirchall
Copy link

Is your feature request related to a problem? Please describe.

A schedule to periodically check rss feeds for new articles and post them in designated channels.
A command to add a RSS feed along the lines of !rss add {link} {channel} {time} etc etc

Describe the solution you'd like
A command will be needed to add/remove/list rss feeds for a server.
When an rss feed is added a schedule is started to fetch the current news and post new articles in the designated channel.

A new table would be needed to store the rss feeds
id | guild_id | channel_id | feed | period | last_time

A scheduleTask will need to be added to pick up these rss feeds, check for new articles which were published after the last time the schedule ran, post the newest, store the current time and reschedule based on the provided time.

Describe alternatives you've considered

None

Additional context

Command set

!rss add {link} {channel} {time} - !rss add http://feeds.bbci.co.uk/news/world/rss.xml #news 15m
Start a schedules task to check the rss feed for new articles and post new ones in the channel supplied
Time could be optional with a default of 1 hour
Link and channel should be required.

!rss list
List all active rss feeds for the server

!rss remove {id} - delete a rss feed
Delete an rss feed for a server by its unique identifier.

Commands should be limited to moderator roles.

Open for discussion

@favna
Copy link
Member

favna commented Jul 11, 2021

Interesting idea. @Tylertron1998 something you may be interested in making after YT notifs is fully done? You're quite into the whole periodic checking and such now.

@Tylertron1998
Copy link
Collaborator

Very interesting - could make for a good microservice. Though, it does beg the question if there should be one central event microservice that forwards events from other smaller microservices, such as youtube notifications, rss feeds, etc.

@favna
Copy link
Member

favna commented Jul 18, 2021

Very interesting - could make for a good microservice. Though, it does beg the question if there should be one central event microservice that forwards events from other smaller microservices, such as youtube notifications, rss feeds, etc.

Skyra.Notifier maybe?

@Tylertron1998
Copy link
Collaborator

is that a good setup? In that case, there would be Skyra.Notifier, that takes in all notifications from all other services and forwards them to the actual bot - Skyra.Youtube which takes in notifications from youtube, and forwards it to Skyra.Notifier - and now Skyra.RSS - which takes RSS feed notifications and forwards it to Skyra.Notifier

@favna
Copy link
Member

favna commented Jul 18, 2021

Sounds good to me

@JABirchall
Copy link
Author

is that a good setup? In that case, there would be Skyra.Notifier, that takes in all notifications from all other services and forwards them to the actual bot - Skyra.Youtube which takes in notifications from youtube, and forwards it to Skyra.Notifier - and now Skyra.RSS - which takes RSS feed notifications and forwards it to Skyra.Notifier

Since we on the topic of what could use these services Skyra.twitch to announce if a channel is live, Skyra.Twitter to post new tweets.

When you think about it, the notification service could be used to expand a lot of functionality.

It also makes sense to delegate these to a separate service as once expanded upon, the notifications could take up a significant load of the bot if enough servers use the features. So keeping the main bot not bogged down by schedules and only handling posting a notification once received from the notification service would be appropriate.

And since skyra has redis support, the communication could be done via redis pub/sub this can keep the bot event driven.

@favna
Copy link
Member

favna commented Jul 18, 2021

Since we on the topic of what could use these services Skyra.twitch to announce if a channel is live,

Twitch notifications are already in Skyra, albeit it through TS. It can be moved to C# I guess, but it's lower priority than new features.

Skyra.Twitter to post new tweets.

This is something that's been a long time request and I think the API for it is finally free so I think we can use it. Used to be it was a paid API with exorbitant prices.

@kyranet kyranet transferred this issue from skyra-project/skyra Jan 4, 2022
@kyranet kyranet changed the title request: RSS feeds tracking(Notifications): add RSS feed support Jan 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants