_ShowFeed: Display RSS Feeds In Any EditMe Page


Bookmark and Share Monday, October 26, 2009

RSS to EditMeEditMe has supported out-bound RSS feeds for some time now. EditMe sites can generate a number of RSS feeds to publish recent changes, page changes, comments, blog posts and more. Well, EditMe's RSS mojo has been kicked up a notch with the ability to dynamically display the contents of external RSS feeds within the content of your EditMe site. What is RSS?

A new include script is now available to all EditMe sites that allows the content of any RSS feed to be displayed within the content of an EditMe page. EditMe uses Google's Feedfetcher service (the engine behind Google Reader, Feedburner, and more) to power this feature. Customers will need to grab a Feedfetcher key from Google before using this include script - it's a painless one-time process.

Here's how to use the new _ShowFeed include:

  1. Find the RSS address for the feed you want to include. Most modern browsers expose the RSS address for a web site with an icon in the right side of the address bar. For example, NPR's feed of top stories is http://www.npr.org/rss/rss.php?id=1002
  2. Edit any page of your EditMe site and enter the following:

    [[include:_ShowFeed http://www.npr.org/rss/rss.php?id=1002]]

  3. Here's what you'll see (the styled box is provided by this page, not by _ShowFeed):

Customize the Feed Display

_ShowFeed provides a few ways to customize how the feed is displayed. First, there are three different format options:

[[include:_ShowFeed <feed_address> excerpts]] - excerpts is the default (and so, optional), displaying what you see above. An excerpt of the content provided in the feed is taken and displayed under each heading.

[[include:_ShowFeed <feed_address> full-content]] - full-content displays the header and all of the content provided in the feed. Note that some feeds provide lots of content, others only provide a small excerpt; _ShowFeed will only show the full content of articles if they're included in the feed to begin with.

[[include:_ShowFeed <feed_address> links]] - links displays a simple bulled list of the titles linked to the stories. This is the most compact option.

By default, _ShowFeed displays 4 items from the feed. You can change this number to, say, 10 by adding limit=10 as follows:

[[include:_ShowFeed <feed_address> limit=10]]

Note that you can only display as many items as are included in the feed. If your limit is more than the number of items in the feed, you'll just get the full number of items.

Tech Tip: All of these options provide code with classes that can be styled with CSS if you are so inclined. Use a tool like Firebug if you want to know what classes are assigned to the feed output. Because _ShowFeed generates its content with JavaScript, you won't be able to see it by just Viewing the Source of the page.

Get Your Feedfetcher Key

The first time you use use _ShowFeed on your site, it will prompt you for a Google Feedfetcher API key. This sounds complicated, but it's not.

Getting an API key from Google is easy (and free):

  1. Go to Google's AJAX Feed API Sign-up Page.
  2. Agree to the Terms and Conditions by checking the box.
  3. Enter your site's address. This should be the address you normally use to access your EditMe site. For example, http://YOURNAME.editme.com. If you use a custom domain for your site, enter that address instead.
  4. You'll be asked to sign into your Google Account.
  5. You'll see a message reading, "Your key is:" followed by a long line of green text gobbledigook. Copy and paste that value into the box provided by _ShowFeed and submit.

_ShowFeed will give you a box to paste your key into. You'll only have to do this once. _ShowFeed will remember your key and use everywhere on your site from then on.

Why Use Google's Feedfetcher?

Why do you have to go through this API key hassle? Why didn't EditMe just create it's own feed reader service? Good question. On the face of it, getting an RSS feed and displaying it seems like a trivial task. But RSS etiquette requires complex optimization so that site's feeds aren't hammered by other sites getting the feed content over and over again when nothing has changed.

For example, EditMe can't go to NPR's web site and get the feed every time somebody views this page. So we'd have to get the feed and store it for a while, only checking back at npr.org once an hour or so to see if there are updates.

But then what if 50 different EditMe customers decide to include the NPR feed on their sites? Now EditMe is getting the feed 50 times per hour, which isn't cool. So we'd have to have a central RSS caching facility.

Well, that's what Google's Feedfetcher is. Google provides a vast infrastructure for checking and caching RSS feeds, and it would be insane to reinvent that wheel. Since Google requires that each individual URL using their Feedfetcher service have it's own key, each EditMe customer must have a key for their own site.

Stay Connected with EditMe

Subscribe via Email

Your Email:

Delivered by FeedBurner