mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Fix for slashdot bug, I think.
This commit is contained in:
parent
9a907277c1
commit
85807dd077
@ -159,11 +159,16 @@ class RSS(callbacks.Privmsg):
|
||||
oldheadlines = []
|
||||
newresults = self.getFeed(url)
|
||||
newheadlines = self.getHeadlines(newresults)
|
||||
for headline in oldheadlines:
|
||||
def headlineEq(h1, h2):
|
||||
return h1.lower().split() == h2.lower().split()
|
||||
for (i, oldheadline) in enumerate(oldheadlines):
|
||||
try:
|
||||
newheadlines.remove(headline)
|
||||
except ValueError:
|
||||
pass
|
||||
newheadline = newheadlines[i]
|
||||
except IndexError:
|
||||
break
|
||||
if headlineEq(oldheadline, newheadline):
|
||||
newheadlines[i] = None
|
||||
newheadlines = filter(None, newheadlines) # Removes Nones.
|
||||
if newheadlines:
|
||||
for channel in channels:
|
||||
bold = self.registryValue('bold', channel)
|
||||
|
@ -44,6 +44,8 @@ if network:
|
||||
|
||||
def testRss(self):
|
||||
self.assertNotError('rss %s' % url)
|
||||
m = self.assertNotError('rss %s' % url)
|
||||
self.failUnless(m.args[1].count('||') == 1)
|
||||
|
||||
def testRssAdd(self):
|
||||
self.assertNotError('rss add advogato %s' % url)
|
||||
|
Loading…
Reference in New Issue
Block a user