One thing that has frustrated me about interacting with LiveJournal programmatically, is that
?format=light
does not work on all pages. It's not really something that affects most users would notice, but certain (Greasemonkey) scripts would be much much easier to write if the entry/journal pages could be guaranteed to follow the same format.
Mostly I've kludged around it by working off of the archive pages, which respond to
?format=light
, so I could get data consistently. I have a script which scrapes the lj-cut text, so it can be seen in the inbox which does this.
murklins has done me one better, with
a script which lj-cuts your inbox, like the entry text. I do not know how I ever lived without this. Lifesaver.
Adore, love. Seriously.
But for other pages, it's been a process of trial and error, trying to figure out whether ?format=light is supported (tag page supports it, showing a page based on s1shortcomings). Uh. Archive pages, as mentioned above. Reply pages and entry pages, obviously, using core, I think.
Not affected by ?format=light are friends and recent entries. LJ site scheme pages, meanwhile depend on the user's site scheme, unless you append ?usescheme=blah, which I always forget to /o\
It's all possible, but it can get messy depending on what you're trying to do. Which is why I love that LJ offers a mobile view. Love <3
The gist of it is that LiveJournal offers a
minimalistic view for mobile phones/browsers (I suspect screenreaders could benefit). No header graphics, less junk overall, more consistent look/feel, and most importantly if you're hijacking it for scripting, it works consistently! To trigger, you need to supply the appropriate user agent:
GM_xmlhttpRequest({
method: "GET",
headers: {"User-Agent":"w"},
url: $url_here,
onload: function(details) {
// do something with details.responseText
});
The important part is the useragent line. The rest is just the normal stuff you need to fetch and process a page.
I haven't used it in an actual script. And since I don't play around with LJ much anymore, I'm not sure when I will. But it is a potential solution to what has up to now been a tedious problem.