<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://labs.echoditto.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>EchoDitto Labs - Putting Yahoo! Pipes and jQuery Together - Comments</title>
 <link>http://labs.echoditto.com/node/52</link>
 <description>Comments for &quot;Putting Yahoo! Pipes and jQuery Together&quot;</description>
 <language>en</language>
<item>
 <title>can you help me 
This</title>
 <link>http://labs.echoditto.com/node/52#comment-4103</link>
 <description>&lt;p&gt;can you help me &lt;/p&gt;
&lt;p&gt;This doesn&#039;t work with IE7.&lt;/p&gt;
</description>
 <pubDate>Mon, 06 Oct 2008 06:29:00 -0700</pubDate>
 <dc:creator>يوتيوب</dc:creator>
 <guid isPermaLink="false">comment 4103 at http://labs.echoditto.com</guid>
</item>
<item>
 <title>favori 6.1 :))</title>
 <link>http://labs.echoditto.com/node/52#comment-4083</link>
 <description>&lt;p&gt;favori 6.1 :))&lt;/p&gt;
</description>
 <pubDate>Mon, 22 Sep 2008 10:09:15 -0700</pubDate>
 <dc:creator>çet</dc:creator>
 <guid isPermaLink="false">comment 4083 at http://labs.echoditto.com</guid>
</item>
<item>
 <title>really .. This doesn&#039;t work</title>
 <link>http://labs.echoditto.com/node/52#comment-4016</link>
 <description>&lt;p&gt;really .. This doesn&#039;t work with IE7.&lt;/p&gt;
</description>
 <pubDate>Sun, 17 Aug 2008 23:19:53 -0700</pubDate>
 <dc:creator>توبيكات</dc:creator>
 <guid isPermaLink="false">comment 4016 at http://labs.echoditto.com</guid>
</item>
<item>
 <title>yes this doesn&#039;t work ie7 :(</title>
 <link>http://labs.echoditto.com/node/52#comment-3939</link>
 <description>&lt;p&gt;yes this doesn&#039;t work ie7 :(&lt;/p&gt;
</description>
 <pubDate>Sat, 26 Apr 2008 15:13:30 -0700</pubDate>
 <dc:creator>hersey</dc:creator>
 <guid isPermaLink="false">comment 3939 at http://labs.echoditto.com</guid>
</item>
<item>
 <title>This doesn&#039;t work with IE7.</title>
 <link>http://labs.echoditto.com/node/52#comment-3919</link>
 <description>&lt;p&gt;This doesn&#039;t work with IE7.&lt;/p&gt;
</description>
 <pubDate>Tue, 08 Apr 2008 04:34:22 -0700</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 3919 at http://labs.echoditto.com</guid>
</item>
<item>
 <title>hi, nice work. what&#039;s the</title>
 <link>http://labs.echoditto.com/node/52#comment-3898</link>
 <description>&lt;p&gt;hi, nice work. what&#039;s the difference to normal js? faster? and maybe you could explain me how you get the favicon.ico.&lt;/p&gt;
</description>
 <pubDate>Sat, 08 Mar 2008 12:01:08 -0800</pubDate>
 <dc:creator>ysamjo</dc:creator>
 <guid isPermaLink="false">comment 3898 at http://labs.echoditto.com</guid>
</item>
<item>
 <title>Putting Yahoo! Pipes and jQuery Together</title>
 <link>http://labs.echoditto.com/node/52</link>
 <description>&lt;p&gt;It&#039;s been a while since I gushed about Yahoo Pipes, hasn&#039;t it?  Well, the RSS-combining service remains insanely powerful.  This morning I decided to try using it with one of my other favorite web technologies: jQuery.  When combined, the two can take the place of many aggregation tasks that previously required a server.&lt;/p&gt;

&lt;p&gt;Here&#039;s the problem I set out to solve: a bunch of my friends write for more than one blog.  They usually have a personal site and contribute to a number of other multi-author blogs.  Sometimes they keep a list of their posts in a del.icio.us sidebar block.  But maintaining that can be kind of a pain &amp;mdash; they have to remember to create a new del.icio.us entry every time they post.  Clients like &lt;a href=&quot;http://codesorcery.net/&quot;&gt;Pukka&lt;/a&gt; make using del.icio.us a breeze, but this workflow is still not as automated as it could be (in that it exists at all).&lt;/p&gt;

&lt;p&gt;As you know, Pipes makes it easy to combine and filter RSS feeds.  &lt;a href=&quot;http://pipes.yahoo.com/pipes/pipe.info?_id=PnGJw3yU3BGyvidq8SvLAg&quot;&gt;Here&#039;s a pipe I threw together&lt;/a&gt; containing feeds from a couple of EchoDitto clients and our main blog.  Naturally we love all of our clients equally, but for my friends&#039; purposes a simple Pipes filter block could be applied to check the dc:author field, ensuring that no coauthors&#039; posts are retrieved.  The result will be an aggregated feed of the author&#039;s entries.&lt;/p&gt;

&lt;p&gt;But how to retrieve them?  jQuery 1.2 added in support for JSONP, an unbelievably slick technology that allows Javascript to load JSON data from different domains.  There are two things you need to know to get this to work with Pipes: how to get the service to spit out JSON, and how to pass it a JSONP callback (which safely assigns the JSON to a given variable name &amp;mdash; without this, loading cross-domain data would be a huge security hole).  Both things are accomplished by adding parameters to your pipe&#039;s querystring.&lt;/p&gt;

&lt;p&gt;Getting JSON is simple.  Just add &lt;em&gt;_render=json&lt;/em&gt;.  Setting up the JSONP callback is even easier: jQuery handles the process of creating a unique name for the JSON container, so you just have to specify a question mark as the callback in the querystring.  Pipes&#039; JSONP param is named &lt;em&gt;_callback&lt;/em&gt;.  So your full JSONP URL will end up looking something like this:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;http://pipes.yahoo.com/pipes/pipe.run?_id=PnGJw3yU3BGyvidq8SvLAg&amp;_render=json&amp;_callback=?&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Now when you call the $.getJSON method you&#039;ll end up with a data structure containing your aggregated blog entries.  You don&#039;t have to go much farther than the &lt;a href=&quot;http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback&quot;&gt;jQuery docs for $.getJSON()&lt;/a&gt; to see how to display that as a list.  I couldn&#039;t resist, though, and added in some extra bells &amp;amp; whistles &amp;mdash; mostly just accounting for Feedburner and using favicon.ico to visually differentiate the entries&#039; originating blog.&lt;/p&gt;

&lt;div id=&quot;sample-feed-block&quot;&gt;&lt;/div&gt;

&lt;style type=&quot;text/css&quot;&gt;
#sample-feed-block ul, #sample-feed-block ul li
{
   list-style-type: none;
   background-image: none !important;
}

#sample-feed-block ul li a
{
   display: block;
   background-repeat: no-repeat;
   background-position: 3px 3px;
   padding: 2px 0 0 25px;
   margin-bottom: 0.5em;
}
&lt;/style&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
   var CssToAdd = new Object();
	$.getJSON(&#039;http://pipes.yahoo.com/pipes/pipe.run?_id=PnGJw3yU3BGyvidq8SvLAg&amp;_render=json&amp;_callback=?&#039;,
   function(data){		
      $.each(data.value.items, function(i,item){
         var domain = ((typeof(item[&#039;feedburner:origLink&#039;])!=&#039;undefined&#039;) ? item[&#039;feedburner:origLink&#039;] : item.link);
         domain = domain.replace(/(http:\/\/.*?\/).*/i,&#039;$1&#039;);
         CssToAdd[domain.replace(/[^a-z]/ig,&#039;_&#039;)] = domain;
         $(&#039;&lt;a&gt;&#039;).attr(&#039;href&#039;,item.link).text(item.title).addClass(domain.replace(/[^a-z]/ig,&#039;_&#039;)).appendTo(&#039;#sample-feed-block&#039;);
      });
      $(&#039;#sample-feed-block a&#039;).wrapAll(&#039;&lt;ul&gt;&#039;).wrap(&#039;&lt;li&gt;&#039;);
		
      $.each(CssToAdd, function(c, d){
         $(&#039;#sample-feed-block a.&#039; + c).css(&#039;background-image&#039;,&#039;url(&#039; + d + &#039;favicon.ico)&#039;);
      });
   });
});
&lt;/script&gt;

&lt;p&gt;And here&#039;s the code, for those interested:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;div id=&quot;sample-feed-block&quot;&amp;gt;&amp;lt;/div&amp;gt;

&amp;lt;style type=&quot;text/css&quot;&amp;gt;
#sample-feed-block ul, #sample-feed-block ul li
{
   list-style-type: none;
   background-image: none;
}

#sample-feed-block ul li a
{
   display: block;
   background-repeat: no-repeat;
   background-position: 3px 3px;
   padding: 2px 0 0 25px;
   margin-bottom: 0.5em;
}
&amp;lt;/style&amp;gt;

&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
$(function(){
   var CssToAdd = new Object();
	$.getJSON(&#039;http://pipes.yahoo.com/pipes/pipe.run?_id=PnGJw3yU3BGyvidq8SvLAg&amp;_render=json&amp;_callback=?&#039;,
   function(data){		
      $.each(data.value.items, function(i,item){
         var domain = ((typeof(item[&#039;feedburner:origLink&#039;])!=&#039;undefined&#039;) ? item[&#039;feedburner:origLink&#039;] : item.link);
         domain = domain.replace(/(http:\/\/.*?\/).*/i,&#039;$1&#039;);
         CssToAdd[domain.replace(/[^a-z]/ig,&#039;_&#039;)] = domain;
         $(&#039;&amp;lt;a&amp;gt;&#039;).attr(&#039;href&#039;,item.link).text(item.title).addClass(domain.replace(/[^a-z]/ig,&#039;_&#039;)).appendTo(&#039;#sample-feed-block&#039;);
      });
      $(&#039;#sample-feed-block a&#039;).wrapAll(&#039;&amp;lt;ul&amp;gt;&#039;).wrap(&#039;&amp;lt;li&amp;gt;&#039;);
		
      $.each(CssToAdd, function(c, d){
         $(&#039;#sample-feed-block a.&#039; + c).css(&#039;background-image&#039;,&#039;url(&#039; + d + &#039;favicon.ico)&#039;);
      });
   });
});
&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;/blockquote&gt;</description>
 <comments>http://labs.echoditto.com/node/52#comments</comments>
 <category domain="http://labs.echoditto.com/taxonomy/term/90">jquery</category>
 <category domain="http://labs.echoditto.com/taxonomy/term/119">pipes</category>
 <category domain="http://labs.echoditto.com/taxonomy/term/17">rss</category>
 <category domain="http://labs.echoditto.com/taxonomy/term/81">yahoo</category>
 <category domain="http://labs.echoditto.com/taxonomy/term/82">yahoopipes</category>
 <pubDate>Fri, 16 Nov 2007 12:17:00 -0800</pubDate>
 <dc:creator>Tom</dc:creator>
 <guid isPermaLink="false">52 at http://labs.echoditto.com</guid>
</item>
</channel>
</rss>
