I have been doing a lot of work on the zevenseas home page over the xmas break, will outline in all in more detail in a future post, however one of the things I wanted to do was display our CodePlex projects, and the number of downloads.
This was inspired by the Vista Gadget Waldek put out some weeks back (CodePlex Downloads Gadget update).
The difficult bit is that the CodePlex site doesn’t provide a nice Web Service so that you can pull this information back, as a result, the only option is, effectively, some sort of screen-scrape. I first of all toyed with doing this client side, a good opportunity to dig into JQuery, however, since I would be querying data from a different domain, this solution would trigger all sorts of security warnings in the browser.
Instead I have gone for a Server Side solution, one that does the following:
- Downloads the “Releases” page for one or more CodePlex solutions.
- Parses through the returned HTML (in a very ugly way) finding just the bits I need.
- Places this into an SPGridView Control.
- Caches for 15 minutes.
This is what it looks like:
Now, given the approach, it is very fragile! If they change the layout of CodePlex it will likely break, though it wont take long to fix.
You configure it by dropping in the URL’s to the Release page for each of your projects, like so:
To download it, head on over to our CodePlex site and download the “Community Web Parts” release, as always, look forward to your feedback!