mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 14:14:37 +01:00
Update RSS.info to accept an rss feed name as well as a url
This commit is contained in:
parent
28fe96c833
commit
173af6567f
@ -1,3 +1,5 @@
|
||||
* Updated RSS.info to accept a feed name as well as a url.
|
||||
|
||||
* Added a signal handler for SIGTERM, so you folks killing your
|
||||
bots uncleanly won't have as many bugs :)
|
||||
|
||||
|
@ -322,12 +322,16 @@ class RSS(callbacks.Privmsg):
|
||||
irc.reply(sep.join(headlines))
|
||||
|
||||
def info(self, irc, msg, args):
|
||||
"""<url>
|
||||
"""<url|feed>
|
||||
|
||||
Returns information from the given RSS feed, namely the title,
|
||||
URL, description, and last update date, if available.
|
||||
"""
|
||||
url = privmsgs.getArgs(args)
|
||||
try:
|
||||
url = self.registryValue('feeds.%s' % url)
|
||||
except registry.NonExistentRegistryEntry:
|
||||
pass
|
||||
feed = self.getFeed(url)
|
||||
info = feed['channel']
|
||||
if not info:
|
||||
|
@ -31,12 +31,15 @@
|
||||
|
||||
from testsupport import *
|
||||
|
||||
url = 'http://advogato.org/rss/articles.xml'
|
||||
url = 'http://www.advogato.org/rss/articles.xml'
|
||||
if network:
|
||||
class RSSTestCase(PluginTestCase, PluginDocumentation):
|
||||
plugins = ('RSS',)
|
||||
def testRssinfo(self):
|
||||
self.assertNotError('rss info %s' % url)
|
||||
self.assertNotError('rss add advogato %s' % url)
|
||||
self.assertNotError('rss info advogato')
|
||||
self.assertNotError('rss info AdVogATo')
|
||||
|
||||
def testRssinfoDoesTimeProperly(self):
|
||||
self.assertNotRegexp('rss info http://slashdot.org/slashdot.rss',
|
||||
@ -44,7 +47,7 @@ if network:
|
||||
|
||||
def testRss(self):
|
||||
self.assertNotError('rss %s' % url)
|
||||
m = self.assertNotError('rss %s' % url)
|
||||
m = self.assertNotError('rss %s 2' % url)
|
||||
self.failUnless(m.args[1].count('||') == 1)
|
||||
|
||||
def testRssAdd(self):
|
||||
|
Loading…
Reference in New Issue
Block a user