Added slogan plugin, updated MTG plugin.
This commit is contained in:
parent
6c04fc80dc
commit
c331e0adf6
2 changed files with 16 additions and 1 deletions
|
@ -12,7 +12,7 @@ def mtg(inp):
|
||||||
|
|
||||||
name = h.find('body/table/tr/td/span/a')
|
name = h.find('body/table/tr/td/span/a')
|
||||||
if name is None:
|
if name is None:
|
||||||
return "no cards found"
|
return "No cards found :("
|
||||||
card = name.getparent().getparent().getparent()
|
card = name.getparent().getparent().getparent()
|
||||||
|
|
||||||
type = card.find('td/p').text.replace('\n', '')
|
type = card.find('td/p').text.replace('\n', '')
|
||||||
|
|
15
plugins/slogan.py
Normal file
15
plugins/slogan.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
from util import hook, http, misc
|
||||||
|
import re
|
||||||
|
|
||||||
|
def sloganize(word):
|
||||||
|
bytes = http.get('http://www.sloganizer.net/en/outbound.php', slogan=word)
|
||||||
|
return bytes
|
||||||
|
|
||||||
|
@hook.command("slogan")
|
||||||
|
def sloganizr(inp, nick=None, say=None, input=None):
|
||||||
|
".slogan <word> -- make a solgan for <word>!"
|
||||||
|
slogan = sloganize(inp)
|
||||||
|
|
||||||
|
slogan = misc.strip_html(slogan)
|
||||||
|
|
||||||
|
return slogan
|
Reference in a new issue