The First Community Server CSModule Contest
One Friday afternoon a few weeks ago Scott Watermasysk decided to have an inpromptu contest to see who could create the best CSModule over the weekend. It was open to all Telligent employees and Community Server community developers, and its purpose was to provide more free functionality for the CS community and to provide some insight to others on how easy it is to write a CSModule.
Technical Background: A CSModule is a one of the ways** you can extend the functionality of Community Server without modifying the original source, similiar to a "plug-in" in other platforms. CS exposes a large number of events that CSModules can subscribe to. Anyone can write a CSModule using any of the .NET languages and run it on a CS site by simply dropping the assembly (.dll file) containg the module in the web sites '/bin" folder, and adding a line to the communityserver.config file. Modules that subscribe to post-related events can get a list of any TextParts that user typed in the post.
Thanks to some competitive spirits and smack talk, not to mention awesome prizes offered for the top 3 spots when Rob Howard decided to make the informal contest an official Telligent sponsored event, we received about 20 submissions. Some went for the scatter shot technique by writing many small (but very cool) modules. I went the other route and wrote a single CSModule that contains quite a bit of functionality. After much thought, I decided to call it the "Web Services Module" because, well, I suck at naming things. My goal was to support as many useful public Web Service API's as I could fit in before the Monday morning deadline.
The first goal was to get Windows Live Local (a.k.a. Microsoft Virtual Earth) map support added. I wanted to have fully functional maps you can drag/zoom rendered inside a blog post. This took longer than I had initialy hoped, probably because it was my first time using any of the map API's. Once I had that working adding Google Maps support was fairly easy and I used the same parameters for both services to make it easier on the user. One hurdle I ran into was that those map API's do not support geocoding (the translation of an address into lattitude and longitude coordinates). Actually the MS maps did in an unsupported kind of way, but it was hokey. But, alas, the Yahoo Maps API does support geocoding for free! So if a user specifies an address to map instead of coordinates the module first makes a call to the Yahoo Maps service to geocode the address, then calls the Microsoft or Google maps service to create the actual map.
Once I had the maps working like a champ, my next goal was adding support for Amazon.com product searches using the Amazon web services. I ran into my deadline while working on this, so wasn't able to make it as robust as I hoped. It takes the product type to search for, a list of keywords to search on, and the number of results, and then renders links and pictures to the Amazon products within the blog post.
We merged all of the modules submitted in the contest into a single pre-compiled assembly for easy deployment and put it up on the communityserver.org File Gallery for public download. We also put documentation about each module on the CS Wiki.
- Modules Download: http://communityserver.org/files/40/csmodules/entry511330.aspx
- Documentation: http://developer.communityserver.org/default.aspx/CS.FirstCSModuleContent
- Forum Thread: http://communityserver.org/forums/thread/511333.aspx
After a week of voting by Telligent & community developers the winners were announced and to my pleasant surprise my Web Services module came in first place! =) Which means I will soon be the proud owner of a new Sony PSP as my bounty, whenever Scott gets around to actually ordering it that is...
In the near future I plan on expanding the Web Services module and releasing the new version along with the full source code. I want to add additional functionality to the Amazon product search feature (such as searching by author) and add support for the eBay web service API.
Below is an example of the Web Services module in use. It's a Google map showing the location of the Telligent world-wide headquarters in Dallas. This won't show up in RSS/ATOM feeds - you'll have to see the web page.
[googlemap:address=17950 Preston Road, Dallas, TX 75252:type=hybrid:zoom=17:label=Telligent World HQ]
** Bonus Technical Explainer: CSModules are only one of several ways you can easily extend Community Server. You can also create CS Jobs that Community Server will run at configurable intervals on a background thread, and spam rules that the CS Spam Add-On will run when it rates a post to determine whether to automoderate or delete it. Hopefully we will have future contests for these other lesser-known expansion types as well!
