mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Removed slashdot and moved it to RSS.py
This commit is contained in:
parent
78a2a21286
commit
6976d587d5
@ -45,12 +45,8 @@ Commands include:
|
|||||||
from baseplugin import *
|
from baseplugin import *
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import time
|
|
||||||
import urllib
|
import urllib
|
||||||
import urllib2
|
import urllib2
|
||||||
import xml.dom.minidom
|
|
||||||
|
|
||||||
import rssparser
|
|
||||||
|
|
||||||
import utils
|
import utils
|
||||||
import debug
|
import debug
|
||||||
@ -234,23 +230,6 @@ class Http(callbacks.Privmsg):
|
|||||||
except urllib2.URLError:
|
except urllib2.URLError:
|
||||||
irc.error(msg, 'Couldn\'t open the search page.')
|
irc.error(msg, 'Couldn\'t open the search page.')
|
||||||
|
|
||||||
_slashdotTime = 0.0
|
|
||||||
def slashdot(self, irc, msg, args):
|
|
||||||
"""takes no arguments
|
|
||||||
|
|
||||||
Returns the current headlines on slashdot.org, News for Nerds, Stuff
|
|
||||||
that Matters.
|
|
||||||
"""
|
|
||||||
if time.time() - self._slashdotTime > 1800:
|
|
||||||
results = rssparser.parse('http://slashdot.org/slashdot.rss')
|
|
||||||
headlines = [x['title'] for x in results['items']]
|
|
||||||
self._slashdotResponse = ' :: '.join(headlines)
|
|
||||||
while len(self._slashdotResponse) > 400:
|
|
||||||
headlines.pop()
|
|
||||||
self._slashdotResponse = ' :: '.join(headlines)
|
|
||||||
self._slashdotTime = time.time()
|
|
||||||
irc.reply(msg, self._slashdotResponse)
|
|
||||||
|
|
||||||
_geekquotere = re.compile('<p class="qt">(.*?)</p>')
|
_geekquotere = re.compile('<p class="qt">(.*?)</p>')
|
||||||
def geekquote(self, irc, msg, args):
|
def geekquote(self, irc, msg, args):
|
||||||
"""[<multiline>]
|
"""[<multiline>]
|
||||||
|
Loading…
Reference in New Issue
Block a user