mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-27 13:31:08 -05:00
Added cyborg.
This commit is contained in:
parent
75ef7630a8
commit
f3b49e4e88
@ -1,3 +1,6 @@
|
|||||||
|
* Added Http.cyborg, a fun little command for getting cyborg
|
||||||
|
abbreviations for names.
|
||||||
|
|
||||||
* Added Sourceforge.totalbugs and Sourceforge.totalrfes
|
* Added Sourceforge.totalbugs and Sourceforge.totalrfes
|
||||||
|
|
||||||
* Removed Admin.setprefixchar, since it's unneeded with the new
|
* Removed Admin.setprefixchar, since it's unneeded with the new
|
||||||
|
@ -202,6 +202,22 @@ class Http(callbacks.Privmsg):
|
|||||||
quote = ' // '.join(quote.splitlines())
|
quote = ' // '.join(quote.splitlines())
|
||||||
irc.reply(quote)
|
irc.reply(quote)
|
||||||
|
|
||||||
|
_cyborgRe = re.compile(r'<p class="mediumheader">(.*?)</p>', re.I)
|
||||||
|
def cyborg(self, irc, msg, args):
|
||||||
|
"""<name>
|
||||||
|
|
||||||
|
Returns a cyborg acronym for <name> from <http://www.cyborgname.com/>.
|
||||||
|
"""
|
||||||
|
name = privmsgs.getArgs(args)
|
||||||
|
name = urllib.quote(name)
|
||||||
|
url = 'http://www.cyborgname.com/cyborger.cgi?acronym=%s' % name
|
||||||
|
html = webutils.getUrl(url)
|
||||||
|
m = self._cyborgRe.search(html)
|
||||||
|
if m:
|
||||||
|
irc.reply(m.group(1))
|
||||||
|
else:
|
||||||
|
irc.errorPossibleBug('No cyborg name returned.')
|
||||||
|
|
||||||
_acronymre = re.compile(r'valign="middle" width="7\d%" bgcolor="[^"]+">'
|
_acronymre = re.compile(r'valign="middle" width="7\d%" bgcolor="[^"]+">'
|
||||||
r'(?:<b>)?([^<]+)')
|
r'(?:<b>)?([^<]+)')
|
||||||
def acronym(self, irc, msg, args):
|
def acronym(self, irc, msg, args):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user