.lnx to return short remote uploaded links
parent
24a6907049
commit
7f55eb7cc5
|
@ -10,8 +10,8 @@ import web
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
def linx(phenny, input):
|
def linx(phenny, input, short=False):
|
||||||
""".linx <url> - Upload a URL to linx.li."""
|
""".linx <url> - Upload a remote URL to linx.li."""
|
||||||
|
|
||||||
url = input.group(2)
|
url = input.group(2)
|
||||||
if not url:
|
if not url:
|
||||||
|
@ -19,7 +19,7 @@ def linx(phenny, input):
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
req = web.post("http://linx.li/vtluug", {'url': url})
|
req = web.post("http://linx.li/vtluug", {'url': url, 'short': short})
|
||||||
except (HTTPError, IOError):
|
except (HTTPError, IOError):
|
||||||
raise GrumbleError("THE INTERNET IS FUCKING BROKEN. Please try again later.")
|
raise GrumbleError("THE INTERNET IS FUCKING BROKEN. Please try again later.")
|
||||||
|
|
||||||
|
@ -32,6 +32,14 @@ def linx(phenny, input):
|
||||||
linx.rule = (['linx'], r'(.*)')
|
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):
|
def lines(phenny, input):
|
||||||
""".lines <nickname> (<today/yesterday/YYYYMMDD>) - Returns the number of lines a user posted on a specific date."""
|
""".lines <nickname> (<today/yesterday/YYYYMMDD>) - Returns the number of lines a user posted on a specific date."""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue