# HG changeset patch # User Jeff Hammel # Date 1268958310 25200 # Node ID 6b8573a62cd30683f306d28235a7ec8adcbdfb3c # Parent d83f35b9b7993855b7e2964f80aef10c0cf3f7ca add a python pastebin script for mozilla (pastebinit strangely doesnt seem to work at all) diff -r d83f35b9b799 -r 6b8573a62cd3 python/pastebin.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/pastebin.py Thu Mar 18 17:25:10 2010 -0700 @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import sys +import urllib2 +import urllib +content = sys.stdin.read() +url = 'http://pastebin.com/api_public.php' +data = dict(paste_code=content, paste_subdomain='mozilla') +values = urllib.urlencode(data) +req = urllib2.Request(url, values) +response = urllib2.urlopen(req) +the_page = response.read() + +print the_page