Justin Toth's Blog

Justin is a web developer living in Maryland

SportsAlert Facebook Application

clock March 12, 2010 21:40 by author Justin Toth

A while ago I posted on developing facebook applications with ASP.NET MVC and the .NET Facebook API. At the time I was developing on a Windows XP box, which runs IIS 5. ASP.NET MVC routing is intended for IIS 6 and above, so it was a painful process. Now that I'm on Windows 7 with IIS 6.5 I decided to come back to that project and give it a try. Amazingly everything just started working without any code changes.

Without further ado, here is the SportsAlert Facebook application:

http://apps.facebook.com/sportsalert/

This app is very simple, allowing you to sign up for SportsAlert and subscribe to teams from within the Facebook app. For the teams you pick, you will get text messages at the end of the games. If you want to subscribe to individual games and/or change the frequency of your alerts (on score change, on quarter change, etc...) then you can login automatically to the SportsAlert web site from the facebook app.



Developing Facebook Applications with ASP.NET MVC

clock July 26, 2009 14:00 by author Justin Toth

As Facebook continues to grow at a rapid pace, more and more businesses have been signing on developers to build custom Facebook applications using Facebook's API's so that they can gain exposure to the Facebook masses and the extraordinary amount of personal data that those users have stored within Facebook.

I recently was asked to build a Facebook application for a project. Naturally, I wanted to find a nice solution that would work with my technology set, mainly ASP.NET, not Facebook's standard language: PHP. I even considered building the app using Silverlight, but decided against it since Silverlight is still so new and hasn't been installed yet by so many users. Since we're in the .NET 3.5 era, I decided to go with ASP.NET MVC rather than the standard web forms version of ASP.NET.

The first thing to do is to find a .NET Facebook framework. Like most people, when I first started searching around, I found two choices: Facebook.NET and the Facebook Developer Toolkit.

The Facebook Developer Toolkit is probably the more popular of the two but it has some shortcomings. From my reading, I got the overwhelming impression that the code base was poorly written by the creator, Clarity Consulting. Furthermore, there is no built-in support for ASP.NET MVC so you have to figure out how to make them mesh yourself. Lastly, many of the methods aren't up to date to match the Facebook API methods so you're on your own to update them manually. The Facebook API's change frequently so it's very hard for a .NET Facebook Famework to keep up with those changes, and the FDT doesn't seem to do too good a job of that.

Facebook.NET was written by a well-respected MSFT employee, Nikhil Kothari, and thus, the code base is nice and clean. It provides for much more flexibility than the FDT, hence it'd be easier to make it work with ASP.NET MVC. However, Nikhil seems to have ditched the project, so it hasn't been updated in a couple of years. That means that its methods no longer match the Facebook API methods.

I wasn't satisfied with either of these solutions so I kept looking and was extremely happy when I found a new project called the .NET Facebook API Client, which is still in Alpha. This project is specifically designed for ASP.NET MVC and provides a Visual Studio 2008 template that sets everything up for you, such as Facebook authentication and using Facebook Connect. The code is nice and clean and is provided to you so that if you run into bugs (since it's an Alpha release), you can modify the code yourself to get it working. Here's the best part - they built a tool that will automatically update the methods when the Facebook API methods change, so it will always match the Facebook API, something that is sorely missing from the big two that I mentioned above.

With the .NET Facebook API Client, I was able to build my first ASP.NET MVC Facebook application without running into too many issues. You can find the link to the app below, which has you enter in your email address, mobile #, and carrier, and then lets you pick your favorite sports teams. It will send you a text message at the end of each game for the teams you picked with the final scores.

http://apps.facebook.com/sportsalert/



About the author

Justin

Justin is a senior developer who has been working with .NET since 2003. His main focus is building highly-interactive web applications using ASP.NET MVC and Dojo or jQuery. Visit his company's site at http://tothsolutions.com.

Page List

Sign in