Jump to content

RSS feeds...


RIRedinPA

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?  :D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.