RIRedinPA Posted September 1, 2010 Share Posted September 1, 2010 Is there a way to pull an rss feed from another site and parse it? I initially tried to hard code it in JS but got blocked by Firefox's security preventing running AJAX on another URL...a Access to restricted URI denied" code: "1012" error... So I switched over to letting someone else do the heavy lifting and tried Yahoo Query Language (http://developer.yahoo.com/yql/) but I followed their directions and I couldn't get it to work (about creating your custom table, not using one of the prefabbed Yahoo tables)... So I decided to give JQuery a go, downloaded jfeed.js but keep getting a "Error: JRss is not defined Source File: http://localhost/js/jfeed.js" error...big grrrrrr at this point... Here's the JQuery code: <script src="js/jquery.js"></script> <script src="js/jfeed.js"></script> <script language="javascript"> $(document).ready(function(){ jQuery.getFeed({ url: 'http://www.outdoornewswire.com/v/current/htdocs/themes/default/xml/Surfing.xml', success: function(feed) { alert(feed.title); } }); }); </script> Any tips would be appreciated. Quote Link to comment Share on other sites More sharing options...
Adam Posted September 2, 2010 Share Posted September 2, 2010 AJAX can only make requests to pages on the same server, whatever framework you use. You'll need to use a server-side language in order to get the feed. Yql I've never used, or particularly familiar with, but I imagine you request an external script from their server using the <script> tag, that then performs a call from their server to the target URL and hands back the data as the script. Quote Link to comment Share on other sites More sharing options...
RIRedinPA Posted September 2, 2010 Author Share Posted September 2, 2010 Hey MrAdam...yeah, I know about the AJAX block, which is why I switched to server side stuff - YQL, on the surface, I don't know what automagical stuff they are doing on the backend, requires that you store the XML file of the RSS feed you want locally, then you can use their console to generate the code for making a JS call that'll allow you to query the RSS feed similar to doing SQL queries. It actually seems pretty cool, if I could get it to work. I'm sitting behind a firewall and am serving my files locally (off a Mac - just for testing) and I wonder if that is having an effect on things...anyway, go ye here, if you'd like to learn more: http://developer.yahoo.com/yql/guide/yql-tutorials.html#tutorial-first_yql_app Regardless, my issue remains unresolved. Anyone? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.