In my previous post you can see the result of my recent lack of sleep. It is something vaguely (understatement alert) inspired by Tesugen.
It is a Python script that gets the latest links I’ve posted to del.icio.us, and then post all the new links to this blog using the Atom API.
At first I thought I should just post the links that I’ve added during the same day, but that wouldn’t work since I don’t have any server that is running all the time. In some cases I might not be able to run the script for a couple of days. So now I keep a local history of which links I’ve blogged, and only blog unblogged links.
It was yesterday I started working on it. I was really tired at work, and my head was aching, so my plan was to go to bed early. Somehow I ended up starting with this and all of a sudden it was 4.30 a.m (and I had to be at work 10 a.m. today). I really enjoy hacking away for fun once in a while.
The main problem was to get the posting to Blogger to work. I used this example as a starting point, but there was something wrong with the login. After remembering reading about Blogger changing the authorization model, I tried using HTTP Basic Authorization over HTTPS. After a while I tried with another password, and it worked, go figure. So I spent a couple of hours trying to fix a problem that wasn’t there. That proves that it was a wise choice to go home early from work. But it was quite interesting learning a bit about WSSE authorization. Getting del.icio.us to work was really easy as soon as I got libxml2 installed and found this example.
There might be some changes to the format of my link blog posts…