update linx module from andreim
parent
8fbc3f6fcc
commit
a951f0d3a7
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python3
|
||||
"""
|
||||
linx.py - linx.li uploader
|
||||
author: mutantmonkey <mutantmonkey@mutantmonkey.in>
|
||||
linx.py - linx.li tools
|
||||
author: mutantmonkey <mutantmonkey@mutantmonkey.in>, andreim <andreim@andreim.net>
|
||||
"""
|
||||
|
||||
from urllib.error import HTTPError
|
||||
|
@ -32,3 +32,25 @@ linx.rule = (['linx'], r'(.*)')
|
|||
|
||||
if __name__ == '__main__':
|
||||
print(__doc__.strip())
|
||||
|
||||
def lines(phenny, input):
|
||||
""".lines <nickname> <date (YYYYMMDD)> - Returns the number of lines a user posted on a specific date."""
|
||||
|
||||
nickname = input.group(2)
|
||||
date = input.group(3)
|
||||
if not nickname or not date:
|
||||
phenny.reply(".lines <nickname> <date (YYYYMMDD)> - Returns the number of lines a user posted on a specific date.")
|
||||
return
|
||||
|
||||
try:
|
||||
req = web.post("http://linx.li/vtluuglines", {'nickname': nickname, 'date': date})
|
||||
except (HTTPError, IOError):
|
||||
phenny.reply("THE INTERNET IS FUCKING BROKEN. Please try again later.")
|
||||
return
|
||||
|
||||
phenny.reply(req)
|
||||
|
||||
lines.rule = (['lines'], r'([a-z0-9\-_\\]+) (.*)')
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(__doc__.strip())
|
||||
|
|
Loading…
Reference in New Issue