Code Project: control Digg with Python

“You should know that, even though there’s a perfectly
reasonable – if slightly out of date – API for Digg, we’re going to
create our own miniature one instead that does just what we need.
If you want to go further you’ll find this an easy place to start,
and it also gives you some good practice in working with XML.

“Many sites use a particular form of communication for their API
and some use several. Of these, the most popular are JSON and XML.
JSON is simpler and easy to integrate into JavaScript, which is why
it often pops up. XML is bigger, chunkier and prettier. It’s also
slightly easier to follow, but you end up with swathes of response
even for a simple query. Still, it’s what we’ll use here.

“To be fair, there isn’t a great deal of difference between
them, but XML is the lingua franca of the web, so if you can handle
API calls through XML, it will stand you in good stead.

“Python handles XML well and has an established module for
manipulating it, but we’re getting ahead of ourselves. The first
thing we need to do is determine how we can interact with the Digg
API in the first place. And, as with many web-savvy social
websites, Digg has lots of documentation for programmers on how to
use the API. Yay!”


Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis