#!/usr/bin/env python # -*-*- encoding:iso-8859-15 filetype:python expandtab:yes tabstop:4 shiftwidth:4 softtabstop:4 # autoindent:yes -*-*- # # havard@dahle.no GPL (C) 2005 __doc__ = "Usage: pipe email message to this script to automatically post it on your blog" BLURL = "http://www.orakel.ntnu.no/~havardda/blogg/xmlrpc.php" # url of blog BLOGG = "kibbitz" # blog name USRNM = "user" # your username PSWRD = "pass" # your password CTGRY = "1" # the category of your posts import sys try: import xmlrpclib import email from email.Header import decode_header from string import join except ImportError: sys.exit(100) def post(msg): t = decode_header(msg.get("Subject")) topic = join([str(i[0]) for i in t]) contents = msg.get_payload(decode=1) rpc = xmlrpclib.ServerProxy(BLURL) publish = xmlrpclib.Boolean(1) try: id = rpc.blogger.newPost("", # appkey BLOGG, # blogid USRNM, # username PSWRD, # password "