Using Yahoo Pipes and Feedburner to Create a Video Feed for Zinc

Adding Reddit's Feed

Reddit's video feed is located at http://www.reddit.com/r/videos/.rss. Here's a snippet:

<item>
  <title>Arrested Development DocumentaryTrailer</title>
  <link>http://www.reddit.com/r/videos/comments/8h1bz/arrested_development_documentarytrailer/</link>
  <guid isPermaLink="true">http://www.reddit.com/r/videos/comments/8h1bz/arrested_development_documentarytrailer/</guid>
  <pubDate>2009-05-01T13:34:52.190116+00:00</pubDate>
  <dc:date>2009-05-01T13:34:52.190116+00:00</dc:date>
  <description>&lt;table&gt; &lt;tr&gt;&lt;td&gt; &lt;a href="http://www.reddit.com/r/videos/comments/8h1bz/arrested_development_documentarytrailer/"&gt;&lt;img src="http://thumbs.reddit.com/t3_8h1bz.png" alt=" Arrested Development DocumentaryTrailer" title=" Arrested Development DocumentaryTrailer" /&gt;&lt;/a&gt; &lt;/td&gt;&lt;td&gt; submitted by &lt;a href="http://www.reddit.com/user/shniken"&gt;shniken&lt;/a&gt; &lt;br/&gt; &lt;a href="http://www.youtube.com/watch?v=O4Q_IjIKPI0"&gt;[link]&lt;/a&gt; &lt;a href="http://www.reddit.com/r/videos/comments/8h1bz/arrested_development_documentarytrailer/"&gt;[34 comments]&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description>
  <media:title>Arrested Development DocumentaryTrailer</media:title>
  <media:thumbnail url="http://thumbs.reddit.com/t3_8h1bz.png" />
</item>

This could be added into Zinc directly, but notice that it links to a reddit comment page. That isn't what we want. Ideally, it would link to the final destination video, so we'll use Yahoo Pipes to massage the feed into a format we like.

First, we hit the "create a pipe" button on the pipes page, and we add a "Fetch Feed" module from the sources group on the left. We put the Reddit video feed URL in the text box:

Fetch Feed

We want to take the contents of each description, run a regex on it, and put the results of the regex in the link field. To do this, we insert a "loop" operator in the middle, running the regex replace .href="(.)">[link.* with $1 for each item.description, and assign results to item.link.

Regex Loop

Great! Now we can save that feed and open it up in Zinc. After you save it, click on "Run Pipe..." at the top. Find the RSS link on the next page, and paste it into Zinc.

Zinc Reddit

Looking good, but there are a few tweaks we could make to get it looking great. First, let's get a better image for the banner. The reddit alien () seems like a good choice. Unfortunately, Yahoo won't let us modify channel-level properties, so we'll import the feed into FeedBurner, which lets you add images to the channel level.

Feedburner

Next, let's get rid of that "[link][3 comments]" stuff. Back to Yahoo Pipes for this: use a String Regex inside a loop again, on each item.description, replacing (.)<a href.>[link].* with $1 and assigning results to item.description:

Regex 2

And that's it. Check out the final feed at http://feeds2.feedburner.com/RedditVideo, and the original pipe at http://pipes.yahoo.com/zinc/redditvideo2.