Friday, April 16, 2004 12:31 PM Jan Tielens

Generating RSS Feeds for SharePoint Sites

UPDATED HERE!!

Today I have a day off, so I decided to work a little bit on my “pet project”: RSS generation for SharePoint sites. Scoble asked for it when I released my RSS Reader Webpart. I know there are some good solutions for this problem available (for example from Siegfried Weber and DevHawk), but I was intrigued by this problem so I decided to craft one myself. Et voila: the What’s New Rss Feed for SharePoint was born (see the end of the post for downloads). I’ve re-used to logic of the What’s New Web Part to retrieve the latest changes on a SharePoint site so I won’t go into detail about that part of the code. The general idea behind this is that the code will go through all the lists on a SharePoint site (you can exclude specific lists) and retrieves the latest changed items (you can specify how many).

An APSX page will build the RSS Feed (more details the actual RSS generation later on) and will use the SharePoint object model to access the contents of a specific SharePoint site. The tricky part here is how the ASPX page can access the SharePoint object model. This issue is solved by deploying the ASPX page to the _VTI_BIN directory of a SharePoint site. You may have noticed this, but this directory is kind-a special: this directory is accessible from each SharePoint site, e.g.: http://sharepoint.leadit.be/_vti_bin/... , http://sharepoint.leadit.be/SubSite/_vti_bin/... . It doesn’t matter which URL you use, you’ll always end up in the same virtual _VTI_BIN directory. To find out where this magical virtual directory maps to on your hard disk, you can use the IIS Manager: navigate to the _VTI_BIN directory and check the properties. The default for the Local Path property is “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\isapi”. So we need to deploy the ASPX page to this directory and of course the corresponding assembly to \BIN in this directory.

The next problem to solve is how to get a hold of the SharePoint web object we want to access. Actually this is quite simple: the GetContextWeb function of the SPControl class can be used to get a SPWeb instance. Based on the Context we’re in, we’ll get the corresponding SPWeb instance.
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
SPWeb web = SPControl.GetContextWeb(Context);

To construct the contents of the RSS Feed, I’ve used the open source RSS.NET library. This library allows you to build an RSS Feed through a very nice object model. When you’re done you can write the contents to the Response stream:
RssFeed rssFeed = new RssFeed();
rssFeed.Channels.Add(rssChannel);
Response.ContentType = "text/xml";
Response.ExpiresAbsolute = DateTime.MinValue;
rssFeed.Write(Response.OutputStream);

To deploy the APSX page, you only have to copy WhatsNewRss.aspx to the directory that maps to the _VTI_BIN virtual directory (probably C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\isapi) and Leadit.SharePoint.Services.dll to the corresponding BIN directory (probably C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\isapi\BIN). Now you should be able to browse to the ASPX page through a SharePoint URL, for example http://sharepoint.leadit.be/_vti_bin/WhatsNewRss.aspx. There are three parameters (which you can add to the URL) that you can use to alter the contents of the feed (similar to the properties of the What’s New Web Part):

  • ExcludeLists
    Specify which lists you want to exclude, separated by a semi-colon (;).
    Default value: Web Part Gallery;fpdatasources
  • ListFields
    Specify what field for a specific list should be used as a title.
    Default value: Contacts=Full Name;Links=URL
  • ItemsToDisplay
    Specify how many items to display.
    Default value: 15

Example:
http://localhost:8000/_vti_bin/WhatsNewRss.aspx?ItemsToDisplay=5&ExcludeLists=MyList&ListFields=Contacts=Last Name

The result is an RSS Feed which you can view in any feed reader, for example SharpReader:

As always, please test before you put this thing in production (remember this is V1). Let me know if you have any problems! One final note: for some feed readers it’s necessary to alter the Directory Security for the _VTI_BIN virtual directory. To access the feed from these feed readers you need to allow Basic Authentication:

Downloads:

Filed under:

Comments

# re: Generating RSS Feeds for SharePoint Sites

Friday, April 16, 2004 6:59 AM by Colin Walker

A good approach :)

# Whats New RSS Feed

Friday, April 16, 2004 1:05 PM by TrackBack

Jan continues to show just how amazing he is. Today I read on his site that he has created a new way to generate an RSS feed that polls your sharepoint lists to display newly added information. Very cool and extremely useful. We need more developers like him in this world of ours. He has the day off and uses it to work on pet SharePoint projects. Great job Jan!...

# Take Outs for 15/16 April 2004

Friday, April 16, 2004 2:35 PM by TrackBack

Take Outs for 15/16 April 2004

# What's New Rss Feed for SharePoint

Sunday, April 18, 2004 9:17 AM by TrackBack

Jan Tielens has released What's New Rss Feed for SharePoint ...

# Neue Tools

Wednesday, April 21, 2004 10:45 PM by TrackBack

Zwei neue Tools f

# re: Generating RSS Feeds for SharePoint Sites

Thursday, April 22, 2004 7:02 AM by Mike Walsh Helsinki

An interesting hickup. I was entering and amending data using the site administrator but all the items thrown up by Rss Feed for SharePoint while specifying the correct change in the correct place at the correct time said that all the changes were done by Esa Viitanen - this is the person who is second on the list of Users for the site and he has only Reader rights!

(The name and password needed meant that I couldn't use it in Tim's RSS Reader web part but RSSReader 1.0.88.0 was fine with this too.)

# Bugfix for What's New Web Part

Monday, April 26, 2004 9:57 AM by TrackBack

# Bugfix for What's New Web Part

Monday, April 26, 2004 9:58 AM by TrackBack

# re: Generating RSS Feeds for SharePoint Sites

Tuesday, April 27, 2004 10:53 AM by spacejunk

I am always getting:

"There was an exception reading the RSS Feed.
The remote server returned an error: (401) Unauthorized."

I can browse directly to the feed (http://testportal/_vti_bin/whatsnewrss.aspx) and that displays the xml code fine.
But I tried it in the Lead It Rss Feed web part and I get the above message.

I have set authentication as shown above in the screenshot for the _vti_bin virtual directory, and even tried Everyone permissions on the two files, but still not luck, any ideas?

# re: Generating RSS Feeds for SharePoint Sites

Wednesday, April 28, 2004 1:05 AM by Jan

There is an updated version available here:
http://weblogs.asp.net/jan/archive/2004/04/26/120508.aspx

# re: Generating RSS Feeds for SharePoint Sites

Wednesday, April 28, 2004 12:33 PM by spacejunk

That is the version I have. I removed the Old Essentials pack and installed the new one. I can not get that RSS Reader to read an RSS feed from whatsnewrss.aspx, but other news Standalone RSS readers will challenge for authentication and read it just fine.

# re: Generating RSS Feeds for SharePoint Sites

Wednesday, April 28, 2004 1:12 PM by Jan

If you want to consume the What's New feed to display it on a SharePoint site, I suggest you use the What's New webpart (also in the package). This will prevent authorization problems and gives you the same result.

# re: Generating RSS Feeds for SharePoint Sites

Wednesday, April 28, 2004 3:33 PM by spacejunk

Well Jan, what about putting whats new from one site on another site in the form of RSS webpart? That was the goal.

Your webparts are nice, I am not saying otherwise, I am just pointing out, your RSS reader will not read your RSS Whats new web service. When one is testing both, esspecially the whatsnewrss.aspx feed it seems logical to just pop that in the already installed Lead It RSS reader webpart to test it out. If it won't do that by design, that is fine, I just wanted to check with this forum to see if anyone else was doing it and maybe I was doing something wrong.

# re: Generating RSS Feeds for SharePoint Sites

Thursday, April 29, 2004 1:22 AM by Jan

The RSSReader webpart then needs some small modifications so it passes along the credentials to the RSS Feed. It's possible, but it will require a few lines of code...

# re: Generating RSS Feeds for SharePoint Sites

Saturday, June 05, 2004 9:57 PM by Jeff

Hi Jan, great part. I also am having the issue aggregating the feed from our portal sites, which all have authenticated access. Can you possibly show us how we can include the credentials?

# Generating RSS Feeds for SharePoint Sites

Thursday, June 10, 2004 5:09 AM by TrackBack

# Generating RSS Feeds for SharePoint Sites

Tuesday, September 14, 2004 2:56 PM by TrackBack

# re: Generating RSS Feeds for SharePoint Sites

Friday, June 02, 2006 2:51 PM by Diego F

When i add a feed url this message appears:

There was an exception reading the RSS Feed.
The ServicePointManager does not support proxies of server scheme.

what´s the trouble, and how can i fix it?

# Using SharePoint WebService to generate a RSS Feed

Tuesday, July 04, 2006 6:08 AM by Daniele Muscetta's Corporate Blog

I started using Sharepoint Portal Server to host a photoblog, but it did not natively support RSS to see when new photos were added. So I wrote this program that gets the items from the SharePoint webservice and outputs the RSS Feed. Since this is an

# RSS feed generators for Team Foundation - Wagalulu - Microsoft

# re: Generating RSS Feeds for SharePoint Sites

Friday, August 11, 2006 3:33 PM by SharePointBUZZ

You are now part of the BUZZ at SharePoint BUZZ

visit  http://www.sharepointbuzz.com

# re: Generating RSS Feeds for SharePoint Sites

Monday, January 22, 2007 4:18 AM by [3!]fiva,[3!]fiva

Very creative... May be you make new design for my sites? Thanks!,Very creative... May be you make new design for my sites? Thanks!

# re: Generating RSS Feeds for SharePoint Sites

Tuesday, February 27, 2007 1:32 AM by girdhari

Hi Jan, I need some help. I want to ask you a question about Sharepoint designer, how can i write a code for button's(server control) click event like a normal .aspx page. I have added one server control in between one <td> using sharepoint designer. Or is it possible that first i create an .aspx page in MS .net studio and publish on sharepoint site.

# re: Generating RSS Feeds for SharePoint Sites

Saturday, March 24, 2007 6:58 AM by Lucy! Please call me,Jonny

Lucy! Please call me,Lucy! Please call me

# re: Generating RSS Feeds for SharePoint Sites

Saturday, March 24, 2007 11:42 AM by Lucy! Please call me,Jonny

Lucy! Please call me,Lucy! Please call me

# re: Generating RSS Feeds for SharePoint Sites

Wednesday, March 28, 2007 4:49 PM by f

fff

# re: Generating RSS Feeds for SharePoint Sites

Tuesday, April 24, 2007 4:21 AM by Teen Blow Job

My compliments to a very nice website. I found lots of intresting things here. p.s. Most of all we don't want him try to fake and weeks

# re: Generating RSS Feeds for SharePoint Sites

Tuesday, April 24, 2007 4:40 AM by ...

[URL=http://www.messin8a.org/patch] patch [/URL]   <a href='http://www.messin8a.org/patch'> patch </a> [URL=http://www.messin8a.org/comunista] comunista [/URL]   <a href='http://www.messin8a.org/comunista'> comunista </a> [URL=http://www.messin8a.org/editor] editor [/URL]   <a href='http://www.messin8a.org/editor'> editor </a> [URL=http://www.messin8a.org/navigatore] navigatore [/URL]   <a href='http://www.messin8a.org/navigatore'> navigatore </a> [URL=http://www.messin8a.org/riassunto] riassunto [/URL]   <a href='http://www.messin8a.org/riassunto'> riassunto </a> [URL=http://www.messin8a.org/totti] totti [/URL]   <a href='http://www.messin8a.org/totti'> totti </a> [URL=http://www.messin8a.org/aree] aree [/URL]   <a href='http://www.messin8a.org/aree'> aree </a> [URL=http://www.messin8a.org/tgcom] tgcom [/URL]   <a href='http://www.messin8a.org/tgcom'> tgcom </a> [URL=http://www.messin8a.org/emulatore] emulatore [/URL]   <a href='http://www.messin8a.org/emulatore'> emulatore </a> [URL=http://www.messin8a.org/piccole] piccole [/URL]   <a href='http://www.messin8a.org/piccole'> piccole </a> [URL=http://www.messin8a.org/simon] simon [/URL]   <a href='http://www.messin8a.org/simon'> simon </a> [URL=http://www.messin8a.org/reaction] reaction [/URL]   <a href='http://www.messin8a.org/reaction'> reaction </a> [URL=http://www.messin8a.org/belli] belli [/URL]   <a href='http://www.messin8a.org/belli'> belli </a> [URL=http://www.messin8a.org/ligure] ligure [/URL]   <a href='http://www.messin8a.org/ligure'> ligure </a> [URL=http://www.messin8a.org/bill] bill [/URL]   <a href='http://www.messin8a.org/bill'> bill </a> [URL=http://www.messin8a.org/sanpaolo] sanpaolo [/URL]   <a href='http://www.messin8a.org/sanpaolo'> sanpaolo </a> [URL=http://www.messin8a.org/cantiere] cantiere [/URL]   <a href='http://www.messin8a.org/cantiere'> cantiere </a> [URL=http://www.messin8a.org/linee] linee [/URL]   <a href='http://www.messin8a.org/linee'> linee </a> [URL=http://www.messin8a.org/add-adhd-test] add adhd test [/URL]   <a href='http://www.messin8a.org/add-adhd-test'> add adhd test </a> [URL=http://www.messin8a.org/cuneo] cuneo [/URL]   <a href='http://www.messin8a.org/cuneo'> cuneo </a> [URL=http://www.messin8a.org/bocce] bocce [/URL]   <a href='http://www.messin8a.org/bocce'> bocce </a> [URL=http://www.messin8a.org/sorriso] sorriso [/URL]   <a href='http://www.messin8a.org/sorriso'> sorriso </a> [URL=http://www.messin8a.org/rossella-brescia] rossella brescia [/URL]   <a href='http://www.messin8a.org/rossella-brescia'> rossella brescia </a> [URL=http://www.messin8a.org/capitale] capitale [/URL]   <a href='http://www.messin8a.org/capitale'> capitale </a> [URL=http://www.messin8a.org/animati] animati [/URL]   <a href='http://www.messin8a.org/animati'> animati </a>

# re: Generating RSS Feeds for SharePoint Sites

Tuesday, April 24, 2007 5:49 PM by Britneyfkhry

<a href= http://10.fresthephp.info >a pebble in my shoe</a> <a href= http://5.fresthepost.info >a775c</a> <a href= http://7.fresmeetplace.info >a picture of the american elm</a> <a href= http://1.fresthephp.info >a z maps uk</a> <a href= http://8.fresthephp.info >a map of woodbridge ontario canada</a>

# re: Generating RSS Feeds for SharePoint Sites

Tuesday, May 01, 2007 1:34 AM by Britneysicmk

<a href= http://www.angelfire.com/planet/dejava >aaron rental and sales</a> <a href= http://www.angelfire.com/funky/bipupe >aac convert mp3 protected</a> <a href= http://www.angelfire.com/crazy/jiqimy >a.r.e. weapons mp3</a> <a href= http://www.angelfire.com/goth/fapycy >a8ab23e1 adframe.php ads.gameforgeads.de n</a> <a href= http://www.angelfire.com/crazy/rokase >a world of our own</a>

# re: Generating RSS Feeds for SharePoint Sites

Friday, May 04, 2007 1:04 PM by lsent

<a href= http://sesille.xlphp.net/sex-orgasm.html|sex orgasm ></a> [url=http://sesille.xlphp.net/sex-orgasm.html|sex orgasm][/url] <a href= http://sesille.xlphp.net/female-***.html|female *** ></a> [url=http://sesille.xlphp.net/female-***.html|female ***][/url] <a href= http://sesille.xlphp.net/only-blow-job.html|only blow job ></a> [url=http://sesille.xlphp.net/only-blow-job.html|only blow job][/url]  

# re: Generating RSS Feeds for SharePoint Sites

Wednesday, May 09, 2007 10:44 AM by Britneygkirh

<a href= http://www.angelfire.com/crazy/tokobi >exerosit</a> <a href= http://www.angelfire.com/hiphop/zilobo >free full version bejeweled</a> <a href= http://www.angelfire.com/droid/wuhodo >deinstallation</a> <a href= http://www.angelfire.com/crazy/raxoxy >driver3 cheat codes</a> <a href= http://www.angelfire.com/crazy/jifogy >de gluteo protese</a>

# re: Generating RSS Feeds for SharePoint Sites

Wednesday, May 23, 2007 7:22 PM by MaryJames

Wazzup  all

How I can change avatar in this forum?

# re: Generating RSS Feeds for SharePoint Sites

Tuesday, June 05, 2007 10:29 PM by lolcat

i can has comment spam? ^_^