?

Log in

No account? Create an account
Semiformalishmaybe

API changes in LJ

Finally put some time into fixing my blog software so it can crosspost to LJ for me again (I think. If this post goes through my fix worked). I have no idea why it took me so long to get in the mood for digging through my code; my blog software is highly-structured, partly-OO clean Perl code. Maybe it's that if I leave a big body of code alone long enough, I always have the urge to significantly refactor it the next time I see it (I am always picking up refactoring ideas, and the comprimises I make at the time always feel ugly when revisited). I'm also a bit scared that the module I'm using that provides the low-level LJ API stuff will be left behind; it hasn't been updated since 2002.

As far as I can tell, one of the types of queries I used to determine the last post on LJ was removed from the API; replicated in a small test program I wrote back when I was first implementing the POUND-LJ glue. Rewriting to avoid "lastn" queries (parameter of 1, replaced with a query type of "one" with parameter of -1) made my test program work. Forward-ported back into my POUNDLj module; hopefully the posting API will still work too.

I wish it were easier to write a clean abstraction for crossposting stuff between various social media sites. The details of LJ are pretty fiddly (you need to use different API calls to backpost something than to just regularly post it, same with back-updating, and so you need to keep track of a lot of state on a journal before you can work with it. It's easier to handle this kind of thing with a high-level API, but some other social media sites you might want to use don't even let you update already-posted things (e.g. twitter). I'm still waiting to see what kind of read/write API we're going to get to G+ (hopefully that won't lead to tons of spam, although it's amusing that it's easy for one developer to block most of their spam, hard for a small ISP to do so, and easy again for a gigantic corporation like Google to do it).

As an aside, Haruki Murakami's 「1Q84」 was the best novel I have read in my life. I was a bit weirded out at how much sex there was in it, but it is an intellectually rich fantasy.

Comments

It works!

Yay, no more manual sync'ing of entries. Also, apparently lastn was very slow. It took roughly 1.5 seconds to finish, while "one" returns practically immediately. Huzzah.
hmm, i have been reading the elephant vanishes on-and-off. i'm not sure how to feel about it; most of the stories seem to have no ending. perhaps i should pick up 1q84 soon?

Edited at 2011-11-23 05:12 pm (UTC)