Created
December 8, 2012 11:30
-
-
Save xuwei-k/4239913 to your computer and use it in GitHub Desktop.
sbt pluing watcher ranking
This file contains 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 sbt._,Keys._ | |
object build extends Build{ | |
lazy val root = Project( | |
"sbt-plugin-ranking", | |
file(".") | |
).settings( | |
scalaVersion := "2.9.2", | |
licenses := Seq("MIT License" -> url("http://www.opensource.org/licenses/mit-license.php")) | |
).dependsOn( | |
uri("git://github.com/xuwei-k/ghscala.git#1bded977f0ce29b") | |
) | |
} |
This file contains 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
package com.github.xuwei_k.sbt_plugin_ranking | |
import com.github.xuwei_k.ghscala.GhScala | |
object Main extends App{ | |
val repo = """https:\/\/github.com\/([a-zA-Z0-9_\-]+)\/([a-zA-Z0-9_\-]+)""".r | |
val url = "http://www.scala-sbt.org/release/docs/Community/Community-Plugins.html" | |
val html = io.Source.fromURL(url).mkString | |
val repoList = repo.findAllIn(html).map{case repo(user,name) => user -> name }.toList.distinct | |
val info = repoList.flatMap{case (u,r) => | |
try{ | |
// Thread.sleep(1000) | |
Option(GhScala.repo(u,r)) | |
}catch{ | |
case e => | |
println(u,r) | |
e.printStackTrace | |
None | |
} | |
} | |
info.sortBy(_.watchers).reverse.foreach{r => println(r.html_url + " " + r.watchers)} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment