diff --git a/modules/head.py b/modules/head.py index 38a4cbf..3f4803b 100644 --- a/modules/head.py +++ b/modules/head.py @@ -17,7 +17,7 @@ import time from html.entities import name2codepoint import web from tools import deprecated -from modules.linx import postedlink +from modules.linx import check_posted_link cj = http.cookiejar.LWPCookieJar() opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj)) @@ -194,9 +194,9 @@ def gettitle(uri, channel): title = title.replace('\n', '') title = title.replace('\r', '') - channels = ['#vtluug'] + channels = ['#vtluug', '#vtcsec'] if channel in channels: - title = "[ " + title + " ] " + postedlink(uri) + title = "[ " + title + " ] " + check_posted_link(uri, channel) else: title = "[ " + title + " ] " else: title = None diff --git a/modules/linx.py b/modules/linx.py index 61b78a0..689ea40 100644 --- a/modules/linx.py +++ b/modules/linx.py @@ -53,7 +53,7 @@ def lines(phenny, input): date = "today" try: - req = web.post("http://linx.li/vtluuglines", {'nickname': nickname, 'date': date, 'sender': input.nick}) + req = web.post("http://linx.li/vtluuglines", {'nickname': nickname, 'date': date, 'sender': input.nick, 'channel': input.sender}) except (HTTPError, IOError): raise GrumbleError("THE INTERNET IS FUCKING BROKEN. Please try again later.") @@ -71,7 +71,7 @@ def posted(phenny, input): return try: - req = web.post("http://linx.li/vtluugposted", {'message': message, 'sender': input.nick}) + req = web.post("http://linx.li/vtluugposted", {'message': message, 'sender': input.nick, 'channel': input.sender}) except (HTTPError, IOError): raise GrumbleError("THE INTERNET IS FUCKING BROKEN. Please try again later.") @@ -80,16 +80,15 @@ def posted(phenny, input): posted.rule = (['posted'], r'(.*)') -def postedlink(url): +def check_posted_link(url, channel): """ helper method for gettitle() """ try: - req = web.post("http://linx.li/vtluugpostedurl", {'url': url}) + req = web.post("http://linx.li/vtluugpostedurl", {'url': url, 'channel': channel}) except: - req = "" + req = "" return req -postedlink.channels = ['#vtluug'] if __name__ == '__main__': print(__doc__.strip())