mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Google: Fix @calc.
This commit is contained in:
parent
2bf0364c0e
commit
6e8b7be0f1
@ -294,7 +294,7 @@ class Google(callbacks.PluginRegexp):
|
|||||||
(self.registryValue('baseUrl', channel), s)
|
(self.registryValue('baseUrl', channel), s)
|
||||||
return url
|
return url
|
||||||
|
|
||||||
def _googleUrlIG(self, s):
|
def _googleUrlIG(self, s, channel):
|
||||||
s = s.replace('+', '%2B')
|
s = s.replace('+', '%2B')
|
||||||
s = s.replace(' ', '+')
|
s = s.replace(' ', '+')
|
||||||
url = r'http://%s/ig/calculator?hl=en&q=%s' % \
|
url = r'http://%s/ig/calculator?hl=en&q=%s' % \
|
||||||
@ -312,7 +312,10 @@ class Google(callbacks.PluginRegexp):
|
|||||||
|
|
||||||
Uses Google's calculator to calculate the value of <expression>.
|
Uses Google's calculator to calculate the value of <expression>.
|
||||||
"""
|
"""
|
||||||
urlig = self._googleUrlIG(expr)
|
channel = msg.args[0]
|
||||||
|
if not isChannel(channel):
|
||||||
|
channel = None
|
||||||
|
urlig = self._googleUrlIG(expr, channel)
|
||||||
js = utils.web.getUrl(urlig).decode('utf8')
|
js = utils.web.getUrl(urlig).decode('utf8')
|
||||||
# Convert JavaScript to JSON. Ouch.
|
# Convert JavaScript to JSON. Ouch.
|
||||||
js = js \
|
js = js \
|
||||||
|
Loading…
Reference in New Issue
Block a user