#!/usr/bin/python import urllib, urllib2 def postComment(blogpostid="", acctid="", anonName="", anonEmail="", anonURL="", comment=""): # "127889" # id test page blogpostid # "1762" # id test page acctid # http://www.intensedebate.com/commentPopup.php?acct=e5d3f90a7af56c306f850efa18f85f1c&postid=0&posttitle=Intense+Debate+Test+Post&posturl=http://www.intensedebate.com server = "http://www.intensedebate.com/js/commentAction/" data = '{"request_type":"0", "params":{ "firstCall":true, "src":0, "blogpostid":%s, "acctid":%s, "parentid":0, "depth":0, "type":0, "token":"", "anonName":"%s", "anonEmail":"%s", "anonURL":"%s", "userid":undefined, "token":"undefined", "mblid":"", "tweetThis":"F", "comment":"%s"}}' % (blogpostid, acctid, anonName.encode("UTF8"), anonEmail, anonURL, comment.encode("UTF8")) params = urllib.urlencode({'data': data}) try: f = urllib2.urlopen("%s?%s" % (server, params)) except URLError, error: print "%s : Error posting comment\n%s" % (error.code, error.read())