2010-03-14 07:21:42 +00:00
|
|
|
from util import hook
|
|
|
|
from lxml import etree
|
2010-03-14 08:01:34 +00:00
|
|
|
import urllib
|
2010-03-14 07:21:42 +00:00
|
|
|
|
|
|
|
host = 'http://bigassmessage.com'
|
|
|
|
|
2010-03-14 08:01:34 +00:00
|
|
|
|
2010-03-14 07:21:42 +00:00
|
|
|
@hook.command
|
|
|
|
def bam(inp):
|
2010-03-14 08:01:34 +00:00
|
|
|
|
|
|
|
if not inp:
|
|
|
|
return 'you forgot something'
|
|
|
|
|
|
|
|
inp = urllib.quote_plus(inp)
|
|
|
|
path = '/dsx_BAM/boe.php?action=saveMsg&theStyle=magic&theMessage=' + inp
|
|
|
|
url = host + path
|
|
|
|
|
|
|
|
try:
|
|
|
|
response = etree.parse(url)
|
|
|
|
status = response.xpath('//status/text()')[0]
|
|
|
|
if status == 'ok':
|
|
|
|
return host + '/' + response.xpath('//msgid/text()')[0]
|
|
|
|
else:
|
|
|
|
return response.xpath('//message/text()')[0]
|
|
|
|
except:
|
|
|
|
pass
|