Peter (hujhax) wrote,
Peter
hujhax

  • Mood:
  • Music:

... wherein Peter can autopodcastinate any LJ feed.

Well, this is kind of neat.

I adapted an existing S2 layer that converts an LJ page to an RSS feed, and then added some code to it so it converts an LJ page to a *podcast* RSS feed.

More specifically, it hunts through each LJ entry, and if that entry includes a link to an mp3, it pumps out a podcast entry.  The description is the LJ entry text, the title is the mp3 link text, and the content is the mp3 the entry linked to.

If a post links to n different mp3s, the code pumps out n podcast entries.

Anyway, here is the layer, and here is a style that uses it.

(Yes, this is how I've spent my Saturday night.  What?)

Note that you can apply this style to any old LJ feed, and the layer will turn that LJ feed into a podcast.  In its current state, it'll go through the latest 50 entries, and any LJ entry that links to an mp3 will morph into a podcast entry as described above.

Obviously, the code isn't the best (my S2 fu is weak).  It's very brittle -- there are some nasty hard-coded constants, and the layer code expects something of the form <a href="http://blah.com/blah.mp3">Blah Blah</a> -- if you just throw in the word 'mp3' at random in your entries, you'll get bad results.  And if you use an ampersand in the mp3-link text, it goes a bit bonkers for some reason.

But I just think it's neat that now *anybody* can turn *any* LJ page into a podcast, so long as the entries include links to mp3s.

In any case, now the peteroke entries are available as a podcast.  w00t!
Tags: tech
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments