måndag 5 april 2010

Writing to pastebin via python API

The parameters are listed here: http://pastebin.com/api.php

This example's pastes only live 10 minutes. Only the paste_code parameter is required.

print "Hello World!\\n"
# send text to pastebin, use syntax highlighting
from urllib import urlopen, urlencode
args={"paste_code": text, 
print urlopen(url,urlencode(args)).read()

Inga kommentarer:

Skicka en kommentar