Python XML-RPC

For our Legends of the Green Dragon game we wanted to ping Technorati the daily news. This helps us advertise the game, and gave me a chance to explore XML-RPC and python a little bit. And I do mean a little bit, look at the code

import xmlrpclib

rpc = xmlrpclib.Server('http://rpc.technorati.com/rpc/ping')
response = rpc.weblogUpdates.ping('[SDF1] Legends Of The Green Dragon - Daily News', 'http://lotgd.sdf1.net/news.php',)

print 'Technorati Replies: ' + response.get('message')

Crazy eh? 3 lines of actual code to send the ping, the 4th only to display if the ping was successful. Put the script in a cron job that runs once every day and your all set.

Subscribe to The Slakinski Log

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe