Created
February 20, 2011 23:51
-
-
Save seanparsons/836435 to your computer and use it in GitHub Desktop.
Example visualizer code for Akka commits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.io.Source | |
import scala.xml._ | |
import scala.collection.mutable._ | |
val source = Source.fromURL("""http://query.yahooapis.com/v1/public/yql?q=select%20commit.author.name,%20commit.id%20from%20github.repo.commits%20where%20id='jboner'%20and%20repo='akka'&diagnostics=true&env=store://datatables.org/alltableswithkeys""") | |
val sourceXML = XML.loadString(source.mkString) | |
val commits = sourceXML \ "results" \ "commits" \ "commit" | |
val authorsToCommits: MultiMap[String, String] = commits.foldLeft(new HashMap[String, Set[String]] with MultiMap[String, String]){(multiMap,commit) => | |
multiMap.addBinding((commit \ "author" \ "name").text, (commit \ "id").text) | |
} | |
source.close() | |
result.set(authorsToCommits.mapValues{set => set.size}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment