Posts Tagged ‘json’

20120121 A hack to parse RSS feeds with php

Just happened to assemble this script hack recently, out of the requirement for a quick’n’dirty feed parsing feature: $feed_contents = file_get_contents($feed_url); $xml = simplexml_load_string($feed_contents, LIBXML_NOCDATA); $feed_array = json_decode(json_encode($xml)); print_r($feed_array); // Surprise!! Now this evidently is not SimplePie or Magpie RSS or whatever feed reader library tickles your fancy*, but assuming the feed will never be [...]

20090729 JSONP explained

I had heard about JSONP several times before, but as I didn’t need to understand it yet, I had just ignored any of the usual reference materials about it… until today. I was trying to access some feeds via ajax and noticed that even if they “loaded”, with readyState being 4 and all that, the [...]

20081202 The BBC accidentally reveals some source code

… in this recipe (scroll to the bottom), and here’s the question: Which programming language are they using in that piece of code? My vote goes for Perl, because… It’s a well-known, public fact that they use Perl. In fact I have even heard someone complained the version of Perl they use is so old [...]