Hein (fub) wrote,

  • Mood:

Javascript syndication

OK, so RSS is the syndication format of choice. Lots of blogs and news sites offer RSS feeds, including LiveJournal. If you want to get to the RSS of a Journal, just point your browser to http://www.livejournal.com/users/[user]/rss . Go here to see the RSS of this Journal!

So, RSS. However, RSS is an XML-based format. Which means that you first have to parse it before you can actually do something with it. RSS readers do this, but if you want to put the latest headlines on your own site, you're plain out of luck -- you gotta parse it first!
Tweakers.net, the best Dutch computer 'prosumer'-site has a good solution to the 'parse first, view later' problem: Javascript includes. In your own webpage, you include a piece of Javascript from the tweakers.net webserver that prints out the current headlines with document.write-statements.

Simple and effective: you just embed a small call to that Javascript, and your page now contains the current headlines. That prompted me to experiment a bit with the various Perl modules (HTML::RSS and HTML::Strip, to be precise). I found a script that turns RSS into HTML and adapted it to turn RSS into a Javascript include.
If I expand the script to use a small database and Net::FTP, I can parse many an RSS feed into small Javascript includes that I can use on my own site.

If anyone's interested in the code, give me a holler. Also, I'd be more than willing to host RSS-to-Javascript files for friends.

  • Update… such as it is

    Wow, I haven’t posted here in… like forever. Let’s do a little update. Vacation. We went on the (now traditional) Texel holiday…

  • The New Normal

    We’re starting to get to grips with our new normal. On one hand, it’s been easy on me, but I also miss certain parts of my routine that…

  • Social distancing

    I’ve read people stating that it should be called “physical distancing” because we’re keeping our physical distance but keep…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded