Gets title from linx for augmented titling capacity

This commit is contained in:
AndreiM
2012-09-24 21:55:58 -04:00
parent 7f55eb7cc5
commit 7b87baeb7e
2 changed files with 14 additions and 101 deletions

View File

@@ -1,7 +1,8 @@
#!/usr/bin/python3
"""
linx.py - linx.li tools
author: mutantmonkey <mutantmonkey@mutantmonkey.in>, andreim <andreim@andreim.net>
author: andreim <andreim@andreim.net>
author: mutantmonkey <mutantmonkey@mutantmonkey.in>
"""
from urllib.error import HTTPError
@@ -10,6 +11,14 @@ import web
import json
def get_title(url, channel):
""" Have linx retrieve the (augmented) title """
try:
return web.post("http://linx.li/vtluuggettitle", {'url': url, 'channel': channel})
except:
return
def linx(phenny, input, short=False):
""".linx <url> - Upload a remote URL to linx.li."""
@@ -88,15 +97,5 @@ def posted(phenny, input):
posted.rule = (['posted'], r'(.*)')
def check_posted_link(url, channel):
""" helper method for gettitle() """
try:
req = web.post("http://linx.li/vtluugpostedurl", {'url': url, 'channel': channel})
except:
req = ""
return req
if __name__ == '__main__':
print(__doc__.strip())