Implementation Notes for Lifeblog posting
Posted by Martin on Mar 7, 2005 in LifeblogWhen I discovered that Movable Type 3 shipped with an Atom server I tried posting from Lifeblog with no success. I was recently inspired to try again on reading a posting by Robert Price who has implemented it for his own blog.
I encountered a number of problems on the way. Firstly, I could never get the phone authenticated. After some trial and error I narrowed this down to differences in the way that Lifeblog and MT create the PasswordDigest. I don't know which is correct, but only one is and I think it's MT. I also had to disable the Nonce timeout check that MT performs. It was too hard to get my server and the phone to agree on the time. The first of these changes means that this version of AtomServer.pm may well not work with other Atom clients. I'm sure that the script could be modified to to check for both forms of PasswordDigest but for now it doesn't. The second change makes the script prone to replay attacks if your username/password is compromised. Given time I may get round to fixing these.
Once I could authenticate I could get down to implementing the Lifeblog posting protocol. In this each segment of an entry is posted individually and then the actual entry posting links them together. This meant implementing a storage area for lifeblog uploads and then processing the entry link tags to put in an image tag for uploaded images or import the actual text for SMS or Notes. Each is wrapped in a DIV tag to enable customisation of the display. I do not delete the original uploads.
Annoyingly, there is no way to set the category the post goes to.
I'm no Perl expert (hadn't touched it in 8 years) but since the MT Perl modules are so well written this was all much easier than I had expected.
