Fixed .urban, added % to stock.py - Thank you @Atheuz :) (original commit: 68e5535ca4
)
This commit is contained in:
parent
f8b05e6b6d
commit
f589133d80
|
@ -4,12 +4,12 @@ grabs a machine gun and riddles <who>'s body with bullets.
|
||||||
gags and ties <who> then throws them off a bridge.
|
gags and ties <who> then throws them off a bridge.
|
||||||
crushes <who> with a huge spiked boulder.
|
crushes <who> with a huge spiked boulder.
|
||||||
glares at <who> until they die of boredom.
|
glares at <who> until they die of boredom.
|
||||||
shivs <who> in the <body> multiple times.
|
shivs <who> in the <body> a few times.
|
||||||
rams a rocket launcher up <who>'s ass and lets off a few rounds.
|
rams a rocket launcher up <who>'s ass and lets off a few rounds.
|
||||||
crushes <who>'s skull in with a spiked mace.
|
crushes <who>'s skull in with a spiked mace.
|
||||||
unleashes the armies of Isengard on <who>.
|
unleashes the armies of Isengard on <who>.
|
||||||
gags and ties <who> then throws them off a building to their death.
|
gags and ties <who> then throws them off a building to their death.
|
||||||
reaches out and punches right though <who>'s chest.
|
reaches out and punches right through <who>'s chest.
|
||||||
slices <who>'s <body> off with a sharpened Katana.
|
slices <who>'s <body> off with a sharpened Katana.
|
||||||
throws <who> to Cthulu and watches them get ripped to shreds.
|
throws <who> to Cthulu and watches them get ripped to shreds.
|
||||||
feeds <who> to an owlbear who then proceeds to maul them violently.
|
feeds <who> to an owlbear who then proceeds to maul them violently.
|
||||||
|
|
|
@ -28,7 +28,7 @@ def stock(inp):
|
||||||
results['color'] = "3"
|
results['color'] = "3"
|
||||||
|
|
||||||
ret = "%(company)s - %(last)s %(currency)s " \
|
ret = "%(company)s - %(last)s %(currency)s " \
|
||||||
"\x03%(color)s%(change)s (%(perc_change)s)\x03 " \
|
"\x03%(color)s%(change)s (%(perc_change)s%%)\x03 " \
|
||||||
"as of %(trade_timestamp)s" % results
|
"as of %(trade_timestamp)s" % results
|
||||||
|
|
||||||
if results['delay'] != '0':
|
if results['delay'] != '0':
|
||||||
|
|
|
@ -23,7 +23,7 @@ def urban(inp):
|
||||||
|
|
||||||
# fetch the definitions
|
# fetch the definitions
|
||||||
url = 'http://www.urbandictionary.com/iphone/search/define'
|
url = 'http://www.urbandictionary.com/iphone/search/define'
|
||||||
page = http.get_json(url, term=input)
|
page = http.get_json(url, term=input, referer="http://m.urbandictionary.com")
|
||||||
defs = page['list']
|
defs = page['list']
|
||||||
|
|
||||||
if page['result_type'] == 'no_results':
|
if page['result_type'] == 'no_results':
|
||||||
|
|
|
@ -42,7 +42,7 @@ def get_json(*args, **kwargs):
|
||||||
|
|
||||||
|
|
||||||
def open(url, query_params=None, user_agent=None, post_data=None,
|
def open(url, query_params=None, user_agent=None, post_data=None,
|
||||||
get_method=None, cookies=False, **kwargs):
|
referer=None, get_method=None, cookies=False, **kwargs):
|
||||||
|
|
||||||
if query_params is None:
|
if query_params is None:
|
||||||
query_params = {}
|
query_params = {}
|
||||||
|
@ -61,6 +61,9 @@ def open(url, query_params=None, user_agent=None, post_data=None,
|
||||||
|
|
||||||
request.add_header('User-Agent', user_agent)
|
request.add_header('User-Agent', user_agent)
|
||||||
|
|
||||||
|
if referer is not None:
|
||||||
|
request.add_header('Referer', referer)
|
||||||
|
|
||||||
if cookies:
|
if cookies:
|
||||||
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(jar))
|
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(jar))
|
||||||
else:
|
else:
|
||||||
|
|
Reference in a new issue