diff --git a/modules/linx.py b/modules/linx.py index 689ea40..e69f3d7 100644 --- a/modules/linx.py +++ b/modules/linx.py @@ -10,8 +10,8 @@ import web import json -def linx(phenny, input): - """.linx - Upload a URL to linx.li.""" +def linx(phenny, input, short=False): + """.linx - Upload a remote URL to linx.li.""" url = input.group(2) if not url: @@ -19,7 +19,7 @@ def linx(phenny, input): return try: - req = web.post("http://linx.li/vtluug", {'url': url}) + req = web.post("http://linx.li/vtluug", {'url': url, 'short': short}) except (HTTPError, IOError): raise GrumbleError("THE INTERNET IS FUCKING BROKEN. Please try again later.") @@ -32,6 +32,14 @@ def linx(phenny, input): linx.rule = (['linx'], r'(.*)') +def lnx(phenny, input): + """ + same as .linx but returns a short url. + """ + linx(phenny, input, True) +lnx.rule = (['lnx'], r'(.*)') + + def lines(phenny, input): """.lines () - Returns the number of lines a user posted on a specific date."""