Friday, 9 May 2008

How I built my personal website in 10 easy steps

Here is an example of how you can use the RSS Toolkit to take RSS feeds from around the web and display them on your website. Although my personal website no longer uses this code, the example remains relevant.

  1. Download RSS Toolkit from CodePlex: http://www.codeplex.com/ASPNETRSSToolkit
  2. Link my Blogger posts feed, comments feed, Flickr feed and Last.fm to Feedburner. Force Blogger feeds to output as RSS 2.0 from Feedburner (switch off Smart Feed), otherwise RSS Toolkit can't process the ATOM entry links correctly.
  3. Set each Feedburner feed to the appropriate RssDataSource and set the DataSource to bind to a simple ASP.Net Repeater.
  4. Setup the RSS Toolkit Caching using the application settings suggested here.
  5. Revamp website design using templates from the Open Source Web Design templates library.
  6. Publish, and see results of Ben Powell's new website.
And, now for some code:

<asp:Repeater
 ID="Repeater1"
 runat="server"
 DataSourceID="RssDataSource1">
 <HeaderTemplate>
  <ul class="sidemenu">
 </HeaderTemplate>
 <ItemTemplate>
  <li><a href="<%# Eval("link") %>"><%# Eval("title") %></a></li>
 </ItemTemplate>
 <FooterTemplate>
  </ul>
 </FooterTemplate>
</asp:Repeater>
<cc1:RssDataSource
 id="RssDataSource1"
 runat="server"
 url="http://feeds2.feedburner.com/benpowell"
 MaxItems="10" />

Update: Well now this is only 6 steps, but who's counting..

0 comments:

Post a Comment