RSS autodiscovery on every page (of a static site)

Thursday, July 10th, 2008

So you have some feeds and want browsers to be able to find them using autodiscovery.

The problem

Unfortunatly, you have static pages and would have to update each one to add the <link> tag. At PCC, we have a site composed of tens-of-thousands of pages. Some are static, some are dynamic applications we can alter, some are closed vendor products.

The solution

Like I said - we have many different types of pages. However, they all use the same JavaScript library!

JS is really good at inserting content into the page. We use the jQuery library, so adding a feed is as easy as:


/* add feed autofind! */
$("head").append('<link rel="alternate" type="application/rss+xml" title="News Releases | Portland Community College" href="http://www.pcc.edu/about/feeds/news/" />');

We can now add/remove feeds at a later date without opening every page on the site. If desired, the script could check the URL and only display the feed on appropriate pages, but for now lets put them everywhere.

Final Thoughts

I looked around the web, but didn’t see much discussion on this meathod. It seems to work in all modern browsers, but let me know if you find any problems.

Safely using FeedBurner

Wednesday, July 9th, 2008

So you have some feeds and you want to track subscriptions using FeedBurner.

The problem?

FeedBurner is a great service and probably will stay that way since it was recently acuired by google. However, it is still a 3rd-party service and that’s somthing you should always be worried about.

You see, when someone subscribes to a burned feed, they will be pointing the agregator to: <feeds.feedburner.com/your-feed>. This means that you will loose all of your subscribers if any of the following happens:

  • FeedBurner goes down, closes shop, or starts charging an outrageous fee. (unlikely)
  • The person who set up the account forgets the password, or becomes a disgruntled employee. (possible)
  • A better service comes along and you decide to switch. (very likley)

The solution

The simple solution is to have users subscribe to a feed on your domain.

  1. Create a folder structure for the feeds - like: /feeds/news/ and /feeds/videos.
  2. In each folder create an index page using you favorite server-side language - index.php, index.cfm, etc. This gives us added flexibility. We can even change the language at a later date!
  3. Use this page to mirror the FeedBurner feed. below is an example in ColdFusion. In PHP you will want to look into cURL:

<!----------------------------------------------------------------------------------------------------
-  This is a placeholder for a feed.
-  Make sure to link to the folder and not this .cfm page for even more flexibility.
-  Created:   2008-04-09 Gabriel McGovern
-  Modified:
----------------------------------------------------------------------------------------------------->

<cfhttp url="http://feeds.feedburner.com/pcc-videos/">
<cfoutput>#cfhttp.filecontent#</cfoutput>

Examples

Check out the feeds we offer for Portland Community College. Each is being run through FeedBurner, but you subscribe to a URL in our domain. If we decide to change services - all we have to do is update the index page. You as a subscriber would never even have to know.

UAD2: The Accessible Video Interface

Monday, October 15th, 2007

Presenter: Gabriel McGovern , Portland Community College

I had a coughing fit. Then my laptop crashed.

(more…)

Bike Commute Challenge

Sunday, September 9th, 2007

Commuter ChallengeI was not sure whether to post this under work, or play.

Portland Community College is currently participating in the Bicycle Transportation Alliance’s Bike Commute Challenge.

When I started working here, I planned to ride everyday. It is only 8miles from my home, but it is almost all uphill. Over the trip, there is a cumulative gain of approximately 1000ft. Because of this, I often hitch a ride in Sam’s truck and then cruise home at the end of the day. Even though it is downhill, the rush hour traffic turns it into quite a workout.

Lets see how well I keep up to the challenge.