Fix for slashdot bug, I think.

This commit is contained in:
Jeremy Fincher 2004-04-20 09:51:55 +00:00
parent 9a907277c1
commit 85807dd077
2 changed files with 11 additions and 4 deletions

View File

@ -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)

View File

@ -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)