blob: 9bb8169dc2671678afa9834cfb590934037df245 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
Earlier this week Google [rolled out a new API][2] designed to let Javascript developers mash up RSS feeds using simple Ajax code.
As with other Google APIs, you'll need to [sign up][3] for a domain-based API key and from there you can cut and paste code from some of the sample applications (see iTunes feed after the jump).
Alternately, if your Javascript-fu is up to it, you can start mashing your own collection of feeds.
Google's Feed API is handy because it lets developers work around Javascript's same-origin policy, which is a security mechanism designed to prevent scripts loaded from one domain from getting or setting properties of a document from a different domain.
It's possible to manually get around the same-origin issues, but it involves somewhat complex server-side proxies and isn't practical for the casual blogger who just wants to drop a customized RSS widget into their page.
The Google Feed API allows you to do exactly that by using FeedFetcher, the same feed caching and sharing mechanism found in Google Reader.
However because you're essentially pulling data from Google Reader, that means that the feed may not be completely "fresh." FeedFetcher retrieves feeds from most sites less than once every hour.
Some more technical details:
* Data can be passed using either JSON or XML
* The AJAX Feed API only provides access to publicly accessible feeds
* Just about every RSS format is supported, including Atom feeds.
If you've used other Google Ajax APIs you'll recognize some familiar patterns and it should be too difficult to get up to speed. Newcomers and others looking to take the plunge, should check out the reasonably [thorough documentation][1].
[1]: http://code.google.com/apis/ajaxfeeds/documentation/ "Google AJAX Feed API Developer Guide"
[2]: http://googleajaxsearchapi.blogspot.com/2007/04/announcing-google-ajax-feed-api.html " Announcing the Google AJAX Feed API"
[3]: http://code.google.com/apis/ajaxfeeds/signup.html "Sign up for the Google AJAX Feed API"
|