Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Thanked 626 Times in 605 Posts

    display any RSS feed

    I just came across the YQL service from yahoo, and I am impressed.

    It allows you run an SQL-like query against web searches, web pages, and rss feeds, among other sources.
    The results are available in JSONP, so you can use the service from any website.
    Unlike Pipes, YQL doesn't seem to require any registration to use.

    Using the RSS feature, i was able to build one of my simplest RSS>HTML scripts yet.

    You might want to customize at least the green parts, but this should be enough to get you started...

    view live demo

    <head>	<title>News</title>
    	body{ background: #fff;}
    	li { padding: 1em; margin-right: 40%;background:#efe; border: 1px solid #000;
    		margin-bottom: 1em;list-style:none;}
    	a { text-decoration: none;font: 133% serif;color:blue;}
    	a:hover { text-decoration: underline;}
    	img {border: 3px solid #000; margin: 0 0.5em;}
    function request(str){  //request builder (don't modify)
      function addScript(u){ var sc2=document.createElement('script'); 
       sc2.src=u;return document.getElementsByTagName('*')[1].appendChild(sc2) }
     var url="http://query.yahooapis.com/v1/public/yql?q="+encodeURIComponent(str)+
     return addScript(url);
    if (![].map) {//for IE and opera compatibility:
     Array.prototype.map=function(fun){var len=this.length,res=new Array(len),t=arguments[1];
     for(var i=0;i<len;i++){if(i in this){res[i]=fun.call(t,this[i],i,this);}}return res;};
    function incoming(ob){ //view builder (customize if needed)
        var r=ob.query.results.item;
            return "<li title='"+a.pubDate+"'>"+ 
    		  a.title.link(a.link).big()+ "<br />"+
    }// end incoming()
    //example request:
    'select title, link, pubDate, description \
    from rss \
    where url="http://www.voanews.com/english/customCF/RecentStoriesRSS.cfm?keyword=Science%20and%20Technology" '
    Last edited by rnd me; 10-30-2009 at 04:50 AM.
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts