Scott on Writing

Musings on technical writing...

RssFeed Version 1.9 Available

A new version of RssFeed - everybody's favorite ASP.NET server control for displaying RSS feeds - has been released.  The new version 1.9 adds two notable improvements:

  1. The RSS feed “slurping“ code/logic has been decoupled from the server control-related code, and
  2. Support for the <enclosure> element has been added.  In RSS version 2.0 this element is used to associate some external document with the item, and is commonly used in podcast syndication.

Item #1 is the one I'm most excited about.  Previous to this version, the code for sucking down the RSS content was embedded deep within the server control.  But why?  This prevented developers from using my control if they wanted complete control over how the data was displayed... or maybe if they didn't want the data displayed at all.  For example, imagine that you wanted to periodically grab a feed, see if any of its items' descriptions contain a particular substring, and then save those results to a database (or email someone, or whatever).  Previously this was not possible with RssFeed - now it's a snap.

Want to grab an RSS feed from a remote server?  Just do:

RssEngine engine = new RssEngine();
RssDocument doc = engine.GetDataSource(url);

Want to enumerate the items in the returned RSS feed looking for descriptions that contain the term “ASP.NET“?  Simple:

foreach(RssItem item in doc.Items)
  if (item.Description.IndexOf(”ASP.NET”) >= 0) ...

In fact, you could use this logic to strip out those entries that don't have the term ASP.NET in them and then bind that modified RssDocument instance to the RssFeed control by assigning it to the control's DataSource property and calling the DataBind() method.  Check out a demo of the RssEngine class.

The enclosure support now makes it easy to display a podcast using RssFeed, including a “Download” column that links to the items enclosure.  You can see a list of the KPBS News podcast for San Diego at this live demo.  Note how those items that have an associated media file specified via an <enclosure> tag have the Download link in the right column.  Click it and start listening to the podcast!

To top it all off, there's even a 4Guys article detailing this new version: Displaying RSS Feeds - A Look at Version 1.9.  You can download RssFeed and check out the online (or offline) documentation at the official RssFeed homepage; there are also a slew of live demos available.

posted on Tuesday, September 27, 2005 2:58 PM

Feedback

# re: RssFeed Version 1.9 Available 9/30/2005 12:37 AM Anacel

Hello Scott,
Thanks for your release.
I have tried it today. I find that the property MaxItems is not working for me. I have tried setting it to different values but the number of the entries displayed are not changing at all.

Did i misunderstand the function of MaxItems or is it a bug? I'm using the binary version of RssFeed Version 1.9

# re: RssFeed Version 1.9 Available 9/30/2005 7:25 AM Scott Mitchell

Anacel, I'll look into this next week (I'm currently out of town). Thanks for the heads up, and if you find any other bugs, lemme know! :-)

# re: RssFeed Version 1.9 Available 10/4/2005 3:58 PM Scott Mitchell

Anacel, good catch on the bug - I fixed it and uploaded a new version (1.9.1) to the GDN Workspace - http://workspaces.GotDotNet.com/RssFeed

Thanks

# re: RssFeed Version 1.9 Available 10/4/2005 7:20 PM Anacel

Thanks Scott

# re: RssFeed Version 1.9 Available 10/6/2005 5:26 AM Binkley

Scott, thanks so much for your work on the .ASP pages - it's awesome! I'd like to use it with my page, calling the rss rather than going through an alternate code/page to do so; my problem is I'm not very familiar with ASP (though I'm working on it). I was hoping you might let me know if there is a way to call multiple feeds into the one code/script? Thanks. Binkley

# re: RssFeed Version 1.9 Available 12/2/2005 7:56 AM Noc

Hi Scott

I'd like to use your RSSFeed control for some of my stuff as well - from what I read, it seems awesome. :)

However, i've been trying to DL for 3 days now, the GDN site is exp tech probs - is there perhaps another DL location avaiable, or temp location until it's up again?

Regards
Noc

# re: RssFeed Version 1.9 Available 12/2/2005 8:36 AM Scott Mitchell

Nov, I was able to download it fine just right now.

If you, or anyone else, has problems downloading the files, ping me over email and I'd be happy to shoot you the files - mitchell@4guysfromrolla.com

# re: RssFeed Version 1.9 Available 5/30/2006 1:06 PM Stefan

How can I make the caching of the rss feed shorter. Now it updates the page but it takes about an hour of 3-4.

Would be nice if if would be like 10 minutes or so?

Title:  
Name:  
Url:
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments   

Add To Your Reader

My Links

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<May 2008>
SMTWTFS
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

Comment Stats

DayTotal% of Total
Sunday 1866.8%
Monday 37913.9%
Tuesday 45316.7%
Wednesday 50418.5%
Thursday 53519.7%
Friday 49418.2%
Saturday 1666.1%
Total 2717100.0%

Hour1Total% of Total
12:00 AM 652.4%
1:00 AM 682.5%
2:00 AM 622.3%
3:00 AM 742.7%
4:00 AM 572.1%
5:00 AM 1033.8%
6:00 AM 1084.0%
7:00 AM 1585.8%
8:00 AM 1716.3%
9:00 AM 1475.4%
10:00 AM 1716.3%
11:00 AM 1816.7%
12:00 PM 1886.9%
1:00 PM 1696.2%
2:00 PM 1605.9%
3:00 PM 1324.9%
4:00 PM 1073.9%
5:00 PM 923.4%
6:00 PM 913.3%
7:00 PM 963.5%
8:00 PM 833.1%
9:00 PM 782.9%
10:00 PM 792.9%
11:00 PM 772.8%
Total 2717100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 5.54144
Monday 5.22339
Tuesday 4.28419
Wednesday 7.67637
Thursday 6.90607
Friday 5.48411
Saturday 5.33160
Total 5.842717

Hour1 Entry MadeAvg.Total
12:00 AM 5.0035
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 7.0035
8:00 AM 5.35107
9:00 AM 6.32278
10:00 AM 6.47246
11:00 AM 4.41181
12:00 PM 6.88330
1:00 PM 3.00111
2:00 PM 5.41222
3:00 PM 8.64285
4:00 PM 4.0589
5:00 PM 5.92154
6:00 PM 4.52113
7:00 PM 9.67174
8:00 PM 9.80147
9:00 PM 5.05111
10:00 PM 5.4265
11:00 PM 4.5732
Total 5.842717

Learn More About Comment Stats
1 - All times GMT -8...


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles