JSON, JSONP , XML, RSS Feed and Google RSS to Jason API

By Clain Dsilva May 20, 2012

 

RSS to JSONP Gone are days of origin policy and cross website data access. In the modern world data needs to be librated. Its one such idea that gave birth to JSON.  JSON is simply JavaScript Object  Notation and it’s a plain text data transfer method using JavaScript. Unlike XML which need a server side program to process the xml, JSON does not need a backend to process.  JSON is processed within your browser by the JavaScript.  Now that’s something that’s really interesting.

JSON

As I mentioned before , JSON a plain text representation of data which is easily readable .

Sample Json Segment:

Advantages :

·         Json data is processed by JavaScript within the browser without sending it to the server.

·         JSON being in plain text format , loads faster. Since it is not made up of tags like XML the amount of data transferred is bare minimum to the actual required data.

·         Loading and processing the data on client side removes server overhead.

·         Live feed becomes a reality with JSON,  Applications that requires live data , for example : Stock market, Sports Score, Live news ..etc can use a JSON feed with fetch intervals set within the JavaScript and inject the live data into webpage.

JSONP

JSONP is the new protocol that lets you access JSON feed from domains other than your domain, in other words remote domain or cross domain.  This is useful when you need to incorporate an API based on  JSON.  Unlike SOAP, REAST, or WML which is markup or tag oriented,  JSON has less data transferred over an API making it a faster and powerful API format.

The Problem

Like any emerging trend, websites / people around the world did not move to the new JSON technology. Most of the websites and services sticked  on to XML / RSS/ATOM format which is basically of XML origin.

The Google RSS to JSON API[Google Feed API]

Google was first to break the XML – JSON barrier.  Google came up with Its own RSS to JSON API based on JSON.  The goggle API looks like this.

Moo Tools Based JavaScript Code segment

The FEED to Jsonaccepts one parameter. Yes you guessed it right, it’s the URL to the RSS feed and returns you a feed in JSON format.

The above code segment will accept a facebook pagename / username and returns their latest wall posts and injects them to HTML page element with the id  ‘facebookfeedholder’

<div id=’facebookfeedholder’></div>

Come on guys give a try with JSONP .. Grab your favourite feed and do some JSON fun.

Hope you enjoyed this post, dont forget to leave your comments.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

4 thoughts on “JSON, JSONP , XML, RSS Feed and Google RSS to Jason API

Leave a Reply

Your email address will not be published. Required fields are marked *