diff --git a/modules/botfun.py b/modules/botfun.py index 10ab18f..8f6aa20 100644 --- a/modules/botfun.py +++ b/modules/botfun.py @@ -6,7 +6,7 @@ author: mutantmonkey import random -otherbot = "truncatedcone" +otherbot = "quone" def botfight(phenny, input): """.botfight - Fight the other bot in the channel.""" diff --git a/modules/linx.py b/modules/linx.py index a7ace62..9c177bb 100644 --- a/modules/linx.py +++ b/modules/linx.py @@ -6,7 +6,7 @@ author: mutantmonkey """ from tools import GrumbleError -import web +import requests import json @@ -15,26 +15,22 @@ def linx(phenny, input, short=False): url = input.group(2) if not url: - phenny.reply("No URL provided. CAN I HAS?") + phenny.reply("No URL provided") return try: - req = web.post("https://linx.li/upload/remote", {'url': url, 'short': short, 'api_key': phenny.config.linx_api_key}) - except (web.HTTPError, web.ConnectionError): - raise GrumbleError("Couldn't reach linx.li") - data = json.loads(req) - if len(data) <= 0 or not data['success']: - phenny.reply('Sorry, upload failed.') - return + url = url.replace(".onion/", ".onion.to/") + + r = requests.get("https://linx.vtluug.org/upload?", params={"url": url}, headers={"Accept": "application/json"}) + if "url" in r.json(): + phenny.reply(r.json()["url"]) + else: + phenny.reply(r.json()["error"]) + + except Exception as exc: + raise GrumbleError(exc) - phenny.reply(data['url']) linx.rule = (['linx'], r'(.*)') -def lnx(phenny, input): - """ - same as .linx but returns a short url. - """ - linx(phenny, input, True) -lnx.rule = (['lnx'], r'(.*)') diff --git a/modules/weather.py b/modules/weather.py index 1d5c7c6..dfdbcfe 100644 --- a/modules/weather.py +++ b/modules/weather.py @@ -80,7 +80,7 @@ def f_weather(phenny, input): phenny.say("No ICAO code found, sorry") return - uri = 'http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT' + uri = 'http://tgftp.nws.noaa.gov/data/observations/metar/stations/%s.TXT' try: bytes = web.get(uri % icao_code) except AttributeError: