Pat Gunn (dachte) wrote,
Pat Gunn

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.


  • Still alive

    Been feeling a bit nostalgic. Not about to return to LiveJournal - their new ownership is unfortunate, but I wanted to briefly note what's been up…

  • Unplugging LJ

    It's about time I pulled the plug on the LJ version of my blog: 1) I'm much more active on G+ than I am with general blogging. I post many times a…

  • Mutual Trust

    I don't know which should be considered more remarkable: That a cat should trust a member of a far larger and stronger species that it can't…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded