Random tweaks

This commit is contained in:
Luke Rogers 2012-03-26 21:59:02 +13:00
parent cb9129aebc
commit 9d0e704eae
4 changed files with 12 additions and 22 deletions

View file

@ -10,14 +10,13 @@ shivs <who> in the <body>.
rams a rocket launcher up <who>'s ass and lets off a few rounds.
crushes <who>'s skull in with a spiked mace.
unleashes the armies of Isengard on <who>.
packs <who> into a SVN repo.
slices <who>'s <body> off with a Katana.
throws <who> to Cthulu!
feeds <who> to an owlbear.
throws <who> to Cthulu and watches them get ripped to shreads.
feeds <who> to an owlbear, who proceeds to maul them.
turns <who> into a snail and salts them.
snacks on <who>'s <body>.
puts <who> into a sack, throws the sack in the river, and hurls the river into space.
goes bowling with <who>'s head.
goes bowling with <who>'s disembodied head.
uses <who>'s <body> as a back-scratcher.
sends <who> to /dev/null!
feeds <who> coke and mentos till they pop!
feeds <who> coke and mentos till they violently explode.

View file

@ -102,5 +102,4 @@ dances upon the grave of <who>'s ancestors.
farts in <who>'s general direction.
flogs <who> with stinging nettle.
intoduces <who> to the Knights who say Ni.
assigns all of the permissions tickets on the BeastNode support system to <who>.
hands <who> a poison ivy joint.

View file

@ -11,12 +11,7 @@ with open("plugins/data/fortunes.txt") as f:
fortunes.append(line.strip())
@hook.command(autohelp=False)
def fortune(inp, nick=None, say=None, input=None):
@hook.command
def fortune(inp):
".fortune -- Fortune cookies on demand."
msg = "(" + nick + ") " + random.choice(fortunes)
if inp:
msg = "(@" + inp + ") " + random.choice(fortunes)
say(msg)
return random.choice(fortunes)

View file

@ -9,6 +9,8 @@ import locale
import datetime
from BeautifulSoup import BeautifulSoup
tags_re = re.compile(r'<[^<]*?>')
TimeZones = {'KST': 9, 'CADT': 10.5, 'EETDST': 3, 'MESZ': 2, 'WADT': 9,
'EET': 2, 'MST': -7, 'WAST': 8, 'IST': 5.5, 'B': 2,
'MSK': 3, 'X': -11, 'MSD': 4, 'CETDST': 2, 'AST': -4,
@ -224,21 +226,16 @@ def get_time(tz):
@hook.command("time")
def timecommand(inp, say=None):
def time_command(inp):
".time <area> -- Gets the time in <area>"
tags_re = re.compile(r'<[^<]*?>')
page = http.get('http://www.google.com/search', q="time in " + inp)
soup = BeautifulSoup(page)
request = http.get('http://www.google.com/search', q="time in " + inp)
soup = BeautifulSoup(request)
response = soup.find('td', {'style': 'font-size:medium'})
if response:
output = response.renderContents()
output = tags_re.sub('\x02', output.strip())
return output
else:
try: