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

Playing With Microsoft MVC

by Jeff Alexander 6. December 2009 09:25

Now that I have a little more free time on my hands I have been trying out some new stuff. I kept hearing about Microsoft MVC and I wanted to play around with it some. The online tutorial was a movie database that I instantly saw as potential to adapt to a Milage application.

See I've been keeping track of the gas milage for our family car's since 2000. I started with my Handspring Visor which ran the PalmOS. I bought a spreadsheet application and entered the milage that way. When I moved to the Pocket PC 2003 OS on my iPaq 2215, I was able to bring over my spreadsheets and continued to enter them via Excel. I even built a couple prototype applications using the C# compact framework but it was always easier to use Pocket Excel than any clunky UI/DB I came up with. Espesially since I could graph, sum, etc quite easily in Excel on my desktop. Even when I switched to a Windows Mobile 6.5 phone I still found myself entering data via a spreadsheet since I always had done it that way.

Today I am using an iPhone and have been reluctant to spend any money on an application to read/write excel files since I will most likely switch phones again in the near future. And since my phone is essentially on the web 24/7 I thought, why don't I write a web application so I can enter data more easily and learn something new?

Using the Microsoft MVC tutorial I am slowly (job hunting is my current priority) working on my new Milage Web application. The first few steps to get this working will be:

  • Defining my database and learning the how the entities framework works - CHECK
  • Get the MVC tutorial working on my hosted server along side BlogEngine.Net - CHECK
  • Using ADO.Net to connect to my current spreadsheet as a DB and importing all my existing data into a SQL database - (Importer works, still need to import)
  • Fix up Edit page to do paging for existing data.
  • Fix up Edit page so create new works well in Safari on my iPhone
  • Fix up Home to show graph of MPG for current car. (Google chart working, going to try Microsoft Chart)
  • Fix up Home to give some interesting details for total cost for gas, total cost per vehicle, last purchse, etc.
  • Security so that only I can add data.
  • Use jQuery somehow in UI to learn something about it

Hopefully this will be a fun little exersize for myself and I might be able to use it as an example for a potential employer.

 

-Jeff

Tags:

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