Skip Ribbon Commands
Skip to main content

Point2Share | Daniel McPherson's SharePoint Blog

:

The zevenseas Community > Blogs > Point2Share | Daniel McPherson's SharePoint Blog > Posts > Free Web Part: CodePlex Statistics
December 31
Free Web Part: CodePlex Statistics

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).

DOWNLOAD

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:

  1. Downloads the “Releases” page for one or more CodePlex solutions.
  2. Parses through the returned HTML (in a very ugly way) finding just the bits I need.
  3. Places this into an SPGridView Control.
  4. Caches for 15 minutes.

This is what it looks like:

image

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:

image

To download it, head on over to our CodePlex site and download the “Community Web Parts” release, as always, look forward to your feedback!

 DOWNLOAD

Comments

Bil Simser

There are plenty of RSS feeds from CodePlex (including releases). Couldn't you have pulled from that instead of parsing html?
System Account on 31/12/2008 08:05

Daniel McPherson

Hey Bil, good to see you!

That was the first place I started too, however in my investigations:
1) None of them actually includes the download stats.
2) Even if they did, I would, more than likely, still have to parse out the downloads somehow.

Anyway, its a hack, but it does the job! <grin>

System Account on 31/12/2008 08:33

Hans Blaauw

And if the RSS feeds aren't enough you can always use Dapper.net to do it.
System Account on 02/01/2009 05:28
 

 Statistics

 
Views: 2434
Comments: 2
Tags:
Published:1632 Days Ago