Announce Plugin for Supybot

I used Supybots News-Plugin for keeping users in a channel up to date, but wasn’t very happy with it. It was quite unconvenient to maintain a list of news and display them regulary via the Scheduler-Plugin.

Because I have quite an experience now, I hacked together an alternative I called Announce.

But see for yourself:

#load the plugin
<monsdar> @load Announce

#add 2 announcements with 24h and 36h expiration time
<monsdar> @announce add 24 Example Title #1: This is announcement #1
<monsdar> @announce add 36 Example Title #2: This is announcement #2

#display the current headlines
<monsdar> @headlines
<@Android> Example Title #1: This is announcement #1
<@Android> Example Title #2: This is announcement #2

#list all the headlines
<monsdar> @announce list
<@Android> monsdar: <0> - Example Title #1
<@Android> monsdar: <1> - Example Title #2

#...30 hours later, item #1 is expired...
#let's clean up a bit
<monsdar> @announce cleanup
<@Android> monsdar: Removed 1 announcements

And in combination with Scheduler:

#load the plugins
<monsdar> @load Scheduler
<monsdar> @load Announce

#add some announcements
<monsdar> @announce add 24 Example Title #1: This is announcement #1
<monsdar> @announce add 36 Example Title #2: This is announcement #2

#add them to a repeat-schedule
<monsdar> @scheduler repeat myHeadlines 20 headlines

#...20 seconds later...
<@Android> Example Title #1: This is announcement #1
<@Android> Example Title #2: This is announcement #2
#...and so on...

#let's add a regular cleanup
#so our DB does not get cluttered with old news
<monsdar> @scheduler repeat myHeadlines 300 announce cleanup

Project: Google Code
Manual: Wiki

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s