Technorati/Python
Update: Get the latest version from the real homepage
Taking a break from all the Java, I've had a quick play with the new Technorati API.
Here's a Python wrapper script that parses the XML the Dave's API calls send to you and returns it in a whole bunch of nested dicts, the way it would have appeared if it had been an XML-RPC call:
MIT-licensed. Share and enjoy. Do send patches to me if you have any changes. The API version is probably already out of date (I'm calling the .xml urls) but it works fine for me right now, so I'm happy.
Notes:
* You need an API key. Save this as apikey.txt in the current directory.
* Run python technorati.py -u http://www.foo.com/ -t to test. (Replace the URL with your own).
* Run python technorati.py -u http://www.foo.com/ --inbound for cosmos results. Use --info and --outbound to get blog info and outbound results.
* Note that the blog info is sent in both the cosmos and outbound queries, so --info isn't really all that useful.
Here are my stats for today:
Update: I'm not the only one :-)
... more like this: [Python, Technorati]
Taking a break from all the Java, I've had a quick play with the new Technorati API.
Here's a Python wrapper script that parses the XML the Dave's API calls send to you and returns it in a whole bunch of nested dicts, the way it would have appeared if it had been an XML-RPC call:
technorati.py
MIT-licensed. Share and enjoy. Do send patches to me if you have any changes. The API version is probably already out of date (I'm calling the .xml urls) but it works fine for me right now, so I'm happy.
Notes:
* You need an API key. Save this as apikey.txt in the current directory.
* Run python technorati.py -u http://www.foo.com/ -t to test. (Replace the URL with your own).
* Run python technorati.py -u http://www.foo.com/ --inbound for cosmos results. Use --info and --outbound to get blog info and outbound results.
* Note that the blog info is sent in both the cosmos and outbound queries, so --info isn't really all that useful.
Here are my stats for today:
{'inboundblogs': 25,
'inboundlinks': 89,
'lastupdate': '2003-05-12 11:10:09 GMT',
'name': 'Second p0st',
'rssurl': 'http://www.myelin.co.nz/post/rss.xml',
'url': 'http://www.myelin.co.nz/post'}
Update: I'm not the only one :-)