Reputation: 75
I've been looking around for a decent jQuery feed/XML parser and found good plugins like jFeed and jParse (among a few others). None of these support retrieving an external feed though, which is something I'm after.
Pretty sure this is down to jQuery's $.ajax() method rather than the plugins themselves (as they'll be built from this).
Is there some sort of hack I could use to override jQuery, or a raw JavaScript alternative? Better still would be a better plugin, but even the more popular ones I found didn't support it.
Thanks
Upvotes: 3
Views: 10057
Reputation: 65254
try this tuturial:
http://visualrinse.com/2008/09/24/how-to-build-a-simple-rss-reader-with-jquery/ (archive.org)
and demo
http://visualrinse.com/bradley/mm491/reader.html (archive.org)
Upvotes: 4
Reputation: 324
I recently built AMJR (Asynchronous Multifeed JS Reader) cause I couldn't find something similar to what you ask...
AMJR was written to cover a specific need: A multi-feed reader written in JS. In other words, a feed reader that takes multiple feeds as input and outputs the last X from all the feeds in chronological order. An implementation you'll surely find in server-side languages but not in JS! Having such a functionality reside on the user's browser (client-side) can lift off some processing load especially on high-traffic sites which happen to integrate external feeds. Think of AMJR as your own "Yahoo Pipes" widget to mashup feeds altogether in the same output block.
To summarize things for AMJR:
Info/download at: http://nuevvo.com/labs/amjr/
Enjoy!
Upvotes: 2
Reputation: 10325
I can only recommend jFeed. I use a fork of it ( https://github.com/uhlenbrock/jfeed ) together with my phonegap project. The fork adds support for parsing the creator
tag, and it works perfectly out of the box.
Upvotes: 0
Reputation: 367
jFeed has a php proxy. I just had this need and jFeed was able to retrieve an external. PLease edit your comment if NOT using php is a requirement.
ANSWER (From what we know): Use jFeed!
:: However I just found out if your feed is 'not well-formed' it will break jFeed. :: Be warned
Upvotes: 0
Reputation: 75
The answer looks to be on this page, using YQL instead of my own PHP proxy to handle the requests.
http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/
After finding out that it's not possible to do a simple JavaScript call to handle these requests, this jQuery plugin looks ideal, going to try it out later.
In fact, for parsing of RSS feeds without jQuery you can use the Google AJAX Feed API. Works a treat.
http://code.google.com/apis/ajaxfeeds/examples.html
Thanks for the replies
Upvotes: 1
Reputation: 4540
If by retrieving an external feed you mean getting a feed from a different domain that the one your web application is, you can't (Same origin policy).
You will need some kind of proxy on the server side, like a PHP or python script (or whatever your favorite language is) that queries the external feeds and returns their contents to your application.
The jFeed plugin you checked has an example of a PHP proxy.
Upvotes: 0