Aristotle (edge_walker) wrote in lj_nifty,

Debastardizing LJ’s Atom 0.3-that-wants-to-be-1.0-when-it-grows-up

Addendum: since the latest changes, this code is obsolete. Thanks, Livejournal crew.

I noticed that LJ has started emitting a weird bastard format that looks like Atom 0.3 and Atom 1.0 together in the same document. Because the fulltext is embedded according to the Atom 1.0 conventions, but in namespace-less elements, no strictly conformant aggregator can find it – neither ones which support Atom 0.3 nor those which support Atom 1.0. Only clients which do not actually use an XML parser can make heads or tails of the current format.

<inset type="political">

I find that very unfortunate, as the Atom WG has always stressed standards compliance as a prerequisite for Atom processors and the format was supposed to clean up the murky swamps of RSS.

Still, I am glad to see LJ is at least moving to upgrade from the deprecated 0.3 format. I hope the transitory period with this bastard format is short.


The current state of affairs amounts to title-only feeds for users of compliant aggregators, such as Liferea (my reader of choice). So I wrote an XSLT transform to generate a clean and proper Atom 1.0 feed:

<?xml version="1.0" encoding="utf-8"?>


<!-- identity copy -->
<xsl:template match="node()|@*">
  <xsl:apply-templates select="@*|node()"/>

<xsl:template match="a03:*" />

 match="a03:feed | a03:id | a03:title
 | a03:subtitle | a03:author | a03:email
 | a03:name | a03:link | a03:published
 | a03:updated | a03:entry | category | content"
 <xsl:element name="{ local-name() }">
  <xsl:apply-templates select="@*|node()"/>


Assuming you have saved this as /home/yourname/.liferea/debastardise-lj-atom.xslt, you can use it in Liferea by bringing up a feed’s properties, checking Use conversion filter on the Feed Source tab, and entering the following filter command:

xsltproc /home/yourname/debastardize-lj-atom.xslt -

This requires xsltproc, of course, which is libxslt’s commandline processor. It is common on Linux/Unix systems because libxslt is required for GNOME. But any other available XSLT processor will do; your aggregator may even have one built in.


  • friends history

    many years ago, we had the marnanel joule that kept track of our friends history. but it went away around 2011. in fact a lot of livejournal has…

  • ArtLJ

    I was screwing around with custom styles earlier when I stumbled across artlj ( Translations available at Google and Microsoft). It…

  • No more grey comment button!

    Last night I hacked together a Greasemonkey script so that anyone affected by the grey comment button problem can post a comment. Any comments or…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded