2012-01-03 14:54:26 -05:00
|
|
|
#!/usr/bin/python3
|
2012-01-03 15:02:57 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
2012-01-03 14:54:26 -05:00
|
|
|
"""
|
|
|
|
stache.py - mustachify.me module
|
|
|
|
author: mutantmonkey <mutantmonkey@mutantmonkey.in>
|
|
|
|
"""
|
|
|
|
|
|
|
|
import web
|
|
|
|
|
|
|
|
def stache(phenny, input):
|
|
|
|
""".stache <url> - Mustachify an image."""
|
|
|
|
url = input.group(2)
|
2012-01-03 15:02:57 -05:00
|
|
|
if not url:
|
|
|
|
phenny.reply("Please provide an image to Mustachify™.")
|
|
|
|
return
|
|
|
|
|
2012-01-03 14:54:26 -05:00
|
|
|
phenny.reply('http://mustachify.me/?src=' + web.quote(url))
|
2012-01-03 15:02:57 -05:00
|
|
|
stache.rule = (['stache'],
|
|
|
|
'(https?:\/\/[^ #]+\.(?:png|jpg|jpeg))(?:[#]\.png)?')
|
2012-01-03 14:54:26 -05:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
print(__doc__.strip())
|