Whisst RSS feed for Google Screensaver

by Jeff Alexander 6. April 2010 20:04

I've been busy all over the place trying to fill in some gaps in my knowledge for job interviews and I have another post to make about an application I'm working on to help make posting pictures to Facebook easier for my wife, Beccah, but that is still in progress. This was a quick and dirty implementation of an idea I had that I figured I should post...

I wanted to put a screen saver on my wife's netbook that would display pictures from our Windows Home Server and Google has a very nice screen saver that will do just that. When I installed it I noticed you could add RSS feeds to the screen saver and have it use a feed for the images source. That got me thinking that I could get the Grandma's setup with a screen saver to see pictures without having to download the pictures to their computers. But how would I source the feed?

Before Facebook was the main vehicle letting family see photo's of our 2 boys, I put together a Wordpress blog and installed the ZenPhoto photo gallery. My first thought for the Google screen saver was to put in a feed to those albums but it turns out Google is utilizing the Yahoo Media RSS specification and the feed generated by ZenPhoto isn't following that spec. Rather than devote my time to re-writing the ZenPhoto PHP feed generation code, I decided to take a different approach.

There is an awesome add-in to Windows Home Server call Whisst written by Adrew Grant that allows you to create public or private web pages served by your Windows Home Server. It's a very handy tool to test out ASP.Net web pages I'm working on, and make other pages available to family. If I need to share a large file with family sometimes I will make a quick web page and give them the directions to download and install on the page and serve it publicly. Whisst allows me to do this quickly and easily. Another feature of Whisst is that you can pick a folder of images and it will create a nice html wrapper around it to display the images. It's another easy way to let family see pictures and it's nice that it can be password protected if you want.

I remembered looking at the html wrapper code for Whiist at one point to see what it was doing and was pretty sure I could enhance what it was doing to serve an RSS Feed. I was going to see the Grandma's on Easter so I wanted to put this together quickly before I left. I didn't want to mess with the IIS config to make a handler for xml so I figured I would create an aspx page that would just return the xml feed but then I found an article about using an ashx handler instead so you don't have the overhead of instantiating a page.

I figured that someone somewhere had written an RSS Feed generator for .NET and I found the ASP.NET RSS Toolkit on CodePlex. The toolkit didn't have a built in class for generating media feeds but it does have a tool that will let you generate a class from a feed so I decided to try to generate a media feed class based off of a working media feed. The Google screen saver listed SmugMug as someone who generates photo feeds and I have a college buddy that works for SmugMug named Chris Abbey. I used his feed (thanks Chris) to generate a class to use with the RSS Toolkit and tweaked the parts it guessed wrong to get a nice class I can use with the RSS toolkit to generate my RSS Feed.

Again this was going to be a quick and dirty exercise so I could get it up and running and perhaps tweak it later. For now all the code in the handler is doing is finding all the .jpg's in the current folder and randomly picking at most 100 of them and generating a feed from those. I'm still unsure how the feed reading and updating is implemented in the Google screen saver but I did read that it didn't seem to look past the first 100 and didn't like to reload the feed. I think 100 random photo's on each feed load will work for now.

I created a folder in my photo's share called RSS and put copies of the photo's I wanted to create a feed for in there. I then used Whisst to create a public page called pictures for the RSS folder. I then copied over my rss.ashx file and the assembly and it worked. Both the Grandma's and our 2 laptops have the Google screen saver setup to feed from the Windows Home Server for the screen saver. All I needed to do was add http://myWHSName.homeserver.com/pictures/rss.ashx to set it up.

I will attach the project (or at least the files) to this post in the future but if anyone wants it before that happens let me know. In the future I should add in support for the image size and dimensions for the feed and maybe add some query string parameters. But I was just happy I was able to get it up and working in an evening and the Google screen saver doesn't seem to mind the rather bare feed.

-Jeff

 

 

Tags: ,

C# | Projects

Comments

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen Modified by Jeff Alexander