Mercurial > hg > config
view python/pbmoz.py @ 654:d325f380e2fb
add a front-end to minidlna
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Fri, 28 Mar 2014 23:01:22 -0700 |
parents | c1390e43b437 |
children |
line wrap: on
line source
#!/usr/bin/env python import urllib, sys if len(sys.argv) == 2: url = "http://%s.pastebin.mozilla.org" % sys.argv[1] fmt = sys.argv[1] else: url = "http://pastebin.mozilla.org" fmt = "None" body = sys.stdin.read() params = [ ('parent_pid', ''), ('code2', body), ('poster', ''), ('expiry', 'd'), ('paste', 'Send'), ('format', fmt), ] data = urllib.urlencode(params) req = urllib.urlopen(url, data) print req.geturl()