10

I have seen server side proxy workarounds for retrieving rss (xmls) from cross-domains. In fact this very question addressess my same problem but gives out a different solution.

I have a constraint of do not use a proxy to retrieve rss feeds. And hence the Google AJAX Feed API solution also goes out of picture. Is there a client-only workaround for this problem.

JSONP is the solution for requests that respond with JSON output. But here, I have RSS feeds which can respond with pure xml .

How do I solve the problem.

2
  • What browsers and platforms have to be supported? Commented Dec 13, 2009 at 13:43
  • All major browsers :- IE 7+, Firefox 3+, Chrome.. Commented Dec 14, 2009 at 10:07

5 Answers 5

4

Use something like Yahoo! Pipes to serve as your proxy and translate the RSS XML into a JSON response.

Here is an article with instructions and code samples that explains how to do it: Yahoo Pipes--RSS without Server Side Scripts.

Sign up to request clarification or add additional context in comments.

2 Comments

yahoo pipes... thats a NO cos, i have internal feeds!! :(
I think for your internal feeds, you'll have to use a proxy.
1

If you have control over both domains, you can try a cross-domain scripting library like EasyXDM, which wraps cross-browser quirks and provides an easy-to-use API for communicating in client script between different domains using the best available mechanism for that browser (e.g. postMessage if available, other mechanisms if not).

Caveat: you need to have control over both domains in order to make it work (where "control" means you can place static files on both of them). But you don't need any server-side code changes.

Another Caveat: there are security implications here-- make sure you trust the other domain's script!

Comments

0

Right now there really isn't a cross-platform solution for cross-site scripting. Do you have control or access to the RSS feeds? If so, why not simply respond with JSON and use JSONP?

There are other things coming down the pike with HTML5, like cross-site messaging (referred to as Cross-Document Messaging) that may be capable of delivering a payload of XML, but last time I checked, they hadn't even fully decided on a size limit for the messaging.

You can see the spec here: http://dev.w3.org/html5/spec/Overview.html#crossDocumentMessages

2 Comments

To answer your first question, No, I dont have a control over the feed. Feeds are everywhere!
They are?! /sarcasm. ;) It was worth asking in the off-chance you were in control of the feed you were retrieving.
0

A solution for cross-domain calls without a server-side proxy is to use a SWF component. You can script yourself one or use the readily available FLSend

The component uses ActionScript's URLRequest to call remote domains and ExternalInterface to communicate with the JavaScript methods that render your content.

1 Comment

You still can't retrieve data from another server though unless the crossdomain.xml file on there allows access so it's not a general solution.
0

The only way I can think of would be to embed a signed java applet on the webpage to retrive the xml and use javascript to interface with that. I'm not even 100% certain what the java security model is for that at present though but I think it would work.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.