SCALA VIENNA WEBAPPRELOADED
Felix Amerbauer, @felixamerbauerNikolay Kushin, @zikolach
Wantedto DO it
What we use
IntegrationEv
ents
and
Phot
osTw
eet t
imeli
ne ContributorsScala Posts
SOME BORING TECH DETAILS
Blogs: how to add your ownGo to Scala Vienna Web repository (https://github.com/scala-vienna/scala-vienna-web)
Fork it and checkout
Find /conf/application.conf file and add your blog record to “blogs.list” section at the bottom
Fix some bugs :)
Ensure that everything works
Commit changes and make pull request
Enjoy and relax!!!
Blogs: using Play configblogs.default.categories = ["scala", "akka", "play", "reactive"] blogs.list = [ {url: "http://blog.papauschek.com/feed/", categories: []}, {url: "http://manuel.bernhardt.io/feed/", categories: []} ]
Add new section to config
val blogs = Play.configuration.getObjectList("blogs.list") match { case Some(list) => { list.flatMap(b => { try { val url = b.get("url").unwrapped().asInstanceOf[String] val cats = b.get("categories").unwrapped().asInstanceOf[util.ArrayList[String]].toSet Seq(Blog(url, if (cats.isEmpty) defaultCategories else cats)) } catch { case e: Throwable => { Logger.warn(e.getMessage); Nil } } }) } …
Read it
API: JSON validation case class Contributor( login: String, id: Long, avatar_url: String, …
Use case classes implicit val contributorFormat =
Json.format[Contributor]
Add implicit Format to the scope
def getContributors: Future[List[Contributor]] = { WS.url("https://api.github.com/repos/rafacm/scala-vienna-web/contributors") .withAuth(apiKey, "x-oauth-basic", Realm.AuthScheme.BASIC) .get().map(response => if (response.status == 200) { response.json.validate[List[Contributor]] .recoverTotal(e => { Logger.warn(s"getContributors: ${e.toString}"); Nil }) } else { Logger.warn(s"getUser: ${response.statusText}"); Nil } ) }
Validate JSON
Talks: how to add your ownGo to Scala Vienna Web repository (https://github.com/scala-vienna/scala-vienna-web)
Fork it and checkout
Add new talk /conf/<yyyymmdd-slug>.md
That’s too complicated - I skip it
Ensure that everything works
Commit changes and make pull request
Enjoy and relax!!!
Talks: file contents example--- title = Integration testing with MongoDB and ScalaTest speaker = Michal Bigos meetupEventId = 106481582 meetupMemberId = 21178561 twitter = teliatko tags = "Scala,ScalaTest,MongoDB" slides = "http://teliatko.github.io/talks/vsug-2013-03_it-with-mongodb.html#/" --- * Strategy for testing on our last Play! project * Why we have done integration testing at all * Using ScalaTest for integration testing with MongoDB * Possibilities of integration testing frameworks * Custom DSL for seeding the MongoDB * Small extensions to Casbah for better query syntax
Talks: using markdownAdd dependency
libraryDependencies ++= Seq( "org.pegdown" % "pegdown" % "1.4.2" )
Read markdown files
val dir = Play.getFile(talksDirectory)
Convert to HTML
private def markdown(markdown: String): Html = Html(pegDownProcessor.markdownToHtml(markdown))
MAKE IT BETTER
COLLABORATORS WANTED!!!
“The older I grow the more I listen to people
who don't talk much.”
– Germain G. Glien
Top Related