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
// we want to be asynchronous here because we are doing several API calls | |
def crawlProjectRepos(project: String):Future[List[RepositoryCommitList]] = { | |
Logger.info("crawling " + project + " by API") | |
val repos = reposFor(project) | |
Logger.debug("REPOS " + repos) | |
for (repo <- repos ) { | |
Logger.info("REPO STATUS FOR " + repo + " : " + Await.result(callApi(buildCommitUrl(project, repo)), Duration.Inf)) | |
} | |
val goodRepos = for { |
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
// we want to be asynchronous here because we are doing several API calls | |
def crawlProjectRepos(project: String):Future[RepositoryCommitList] = { | |
Logger.info("crawling " + project + " by API") | |
val repos = reposFor(project) | |
val commitList:scala.collection.mutable.ListBuffer[Commit] = scala.collection.mutable.ListBuffer[Commit]() | |
val commits = for { | |
repo <- repos; | |
c <- callApi(buildCommitUrl(project, repo)); | |
rc <- breakable { | |
if ( c.status != 200 ) { |
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
// we want to be asynchronous here because we are doing several API calls | |
def crawlProjectRepos(project: String) = { | |
implicit val commitReads: Reads[Commit] = ( | |
(JsPath \ "id").read[Long] and | |
(JsPath \ "gitId").read[String] and | |
(JsPath \ "message").read[String] and | |
(JsPath \ "author" \ "name").read[String] and | |
(JsPath \ "author" \ "emailAddress").read[String] and | |
(JsPath \ "authorTimestamp").read[Option[DateTime]](Reads.optionWithNull(jodaDateReads("yyyy-MM-dd'T'HH:mm:ss'Z"))) | |
)(Commit.apply _) |
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
go run camrelay.go | |
libva info: VA-API version 0.37.0 | |
libva info: va_getDriverName() returns -1 | |
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null) | |
libva info: VA-API version 0.37.0 | |
libva info: va_getDriverName() returns -1 | |
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null) | |
libva info: VA-API version 0.37.0 | |
libva info: va_getDriverName() returns -1 | |
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null) |
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
[warn] ==== local: tried | |
[warn] /root/.ivy2/local/com.typesafe.sbt/sbt-coffeescript/scala_2.10/sbt_0.13/1.0.0/ivys/ivy.xml | |
[warn] ==== public: tried | |
[warn] https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-coffeescript_2.10_0.13/1.0.0/sbt-coffeescript-1.0.0.pom | |
[warn] ==== Typesafe repository: tried | |
[warn] https://repo.typesafe.com/typesafe/releases/com/typesafe/sbt/sbt-coffeescript_2.10_0.13/1.0.0/sbt-coffeescript-1.0.0.pom | |
[warn] ==== Typesafe Maven Repository: tried | |
[warn] http://repo.typesafe.com/typesafe/maven-releases/com/typesafe/sbt/sbt-coffeescript_2.10_0.13/1.0.0/sbt-coffeescript-1.0.0.pom | |
[warn] ==== scalaz-bintray: tried | |
[warn] http://dl.bintray.com/scalaz/releases/com/typesafe/sbt/sbt-coffeescript_2.10_0.13/1.0.0/sbt-coffeescript-1.0.0.pom |
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
dbf.flatMap { case Nil => api future; case stuff => Future.succes(stuff) } |
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
devin@fartorias:~/go/src/github.com/ziutek/gst/examples$ GST_DEBUG=3 go run live_webm.go | |
0:00:00.501007625 18266 0x22bb290 WARN structure gststructure.c:195:gst_structure_validate_name: Invalid character ',' at offset 11 in structure name: video/x-raw,format=yuv | |
(live_webm:18266): GStreamer-CRITICAL **: gst_structure_new_empty: assertion 'gst_structure_validate_name (name)' failed | |
(live_webm:18266): GStreamer-CRITICAL **: gst_structure_take_value: assertion 'structure != NULL' failed | |
(live_webm:18266): GStreamer-CRITICAL **: gst_structure_take_value: assertion 'structure != NULL' failed | |
(live_webm:18266): GStreamer-CRITICAL **: gst_structure_take_value: assertion 'structure != NULL' failed |
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
// we want to be asynchronous here because we are doing several API calls | |
def crawlProjectRepos(project: String) = { | |
val repos = reposFor(project) | |
val commits = for (repo <- repos) | |
yield for (c <- callApi(buildCommitUrl(project, repo))) | |
// not going to worry about creating a Commit object right now | |
// this is faster and when it comes time to insert info | |
// into the db, we can just pull out the values needed | |
yield Map(repo -> (c \ "values").as[List[JsValue]]) |
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
def callApi(url:String): Future[JsValue] = { | |
implicit val context = play.api.libs.concurrent.Execution.Implicits.defaultContext | |
val urlWithParams = url + "?" + pageSizeParam | |
val request: WSRequest = ws.url(urlWithParams) | |
val response = request.withHeaders( | |
"Accept" -> "application/json", | |
"Authorization" -> "Basic .....") | |
.get().map { response => | |
if (response.status == 200) { | |
response.json |
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
"crawlProjectRepos" should { | |
"successfully hit each URL in the list" in new WithApplication { | |
val crawler = new Stash(25) | |
for (commitMap <- Await.result(crawler.crawlProjectRepos(project), Duration.Inf)) { | |
commitMap must not be empty | |
commitMap must have length(be_<=(25)) | |
for ((repo, commitList) <- commitMap) { | |
commitList must not be empty | |
commitList must have length(be_<=(25)) | |
} |