For the past few days I've been playing around with JavaScript a bit.
When I'm learning I like to have a little project to play around with to give me some direction. I uhmed & ahhed and eventually decided it was high time to update
my extremely out-dated website (it still has a fire logo for chrissakes - ugh!). So I've been rebuilding it as a
(
Read more... )
Comments 2
I've been waiting for tom to complete his comprehensive atom/rss parser in JavaScript (based on the Python feed passing testsuite.) He's been having hardware problems though
Reply
The long answer:
* I use zimki.remote.get to fetch the atom feed as text
* I remove all the namespaces from the Atom feed to make parsing it easier.
* I create a new E4X XML object & cache it (E4X is sooo much easier to use)
* I find all the xml nodes I want & convert them to JSON both manually & using uneval()
* I know it's not bullet proof, so I cross my fingers it works properly ;-)
It's not bullet-proof -- I'd certainly prefer to use a proper Atom parser. Also, writing one wasn't my goal here.
The main bits of the code:
var blogUrl = 'http://www.livejournal.com/users/spurkis/data/atom... )
Reply
Leave a comment