diff --git a/modules/linx.py b/modules/linx.py index cddd824..3e1799f 100644 --- a/modules/linx.py +++ b/modules/linx.py @@ -34,14 +34,26 @@ if __name__ == '__main__': print(__doc__.strip()) def lines(phenny, input): - """.lines - Returns the number of lines a user posted on a specific date.""" + """.lines () - 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 - Returns the number of lines a user posted on a specific date.") + if input.group(2): + info = input.group(2).split(" ") + + + if len(info) == 1: + nickname = info[0] + date = "today" + elif len(info) == 2: + nickname = info[0] + date = info[1] + else: + phenny.reply(".lines () - Returns the number of lines a user posted on a specific date.") + return + else: + phenny.reply(".lines () - 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): @@ -50,7 +62,7 @@ def lines(phenny, input): phenny.reply(req) -lines.rule = (['lines'], r'([A-Za-z0-9\-_\\]+) (.*)') +lines.rule = (['lines'], r'(.*)') if __name__ == '__main__': print(__doc__.strip())