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?

# re: RssFeed Version 1.9 Available 12/23/2008 3:13 AM Stephen Davidson

Great control, been using it over the last week. I wondered if there is an option to strip out any rogue HTML tags which could upset my design when brining the feed in...

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

My Links

Ads Via DevMavens

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<March 2010>
SMTWTFS
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Comment Stats

DayTotal% of Total
Sunday 2056.8%
Monday 42514.1%
Tuesday 51917.2%
Wednesday 55618.4%
Thursday 58019.2%
Friday 54718.1%
Saturday 1886.2%
Total 3020100.0%

Hour1Total% of Total
12:00 AM 782.6%
1:00 AM 812.7%
2:00 AM 682.3%
3:00 AM 822.7%
4:00 AM 692.3%
5:00 AM 1264.2%
6:00 AM 1193.9%
7:00 AM 1816.0%
8:00 AM 1926.4%
9:00 AM 1585.2%
10:00 AM 1886.2%
11:00 AM 1936.4%
12:00 PM 2016.7%
1:00 PM 1846.1%
2:00 PM 1695.6%
3:00 PM 1354.5%
4:00 PM 1153.8%
5:00 PM 1073.5%
6:00 PM 1013.3%
7:00 PM 1073.5%
8:00 PM 923.0%
9:00 PM 882.9%
10:00 PM 913.0%
11:00 PM 953.1%
Total 3020100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 5.00160
Monday 4.80384
Tuesday 4.04477
Wednesday 7.39680
Thursday 6.26676
Friday 5.07466
Saturday 4.78177
Total 5.403020

Hour1 Entry MadeAvg.Total
12:00 AM 5.2937
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 3.8550
8:00 AM 3.72134
9:00 AM 6.06297
10:00 AM 5.63276
11:00 AM 4.22194
12:00 PM 6.16351
1:00 PM 3.09133
2:00 PM 4.89230
3:00 PM 7.67322
4:00 PM 4.00108
5:00 PM 6.07170
6:00 PM 4.64116
7:00 PM 8.95188
8:00 PM 8.63164
9:00 PM 5.00115
10:00 PM 6.31101
11:00 PM 4.5732
Total 5.403020

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


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles