Scala Vienna Website: reloaded

  • 170 views
Uploaded on

 

More in: Technology , Design
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
170
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. SCALA VIENNA WEBAPP RELOADED Felix Amerbauer, @felixamerbauer Nikolay Kushin, @zikolach
  • 2. Wanted to DO it
  • 3. What we use
  • 4. Scala Posts Contributors Tweet timeline Events and Photos Integration
  • 5. SOME BORING TECH DETAILS
  • 6. Blogs: how to add your own Go 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!!!
  • 7. Blogs: using Play config Add new section 
 to config Read it blogs.default.categories = ["scala", "akka", "play", "reactive"] blogs.list = [ {url: "http://blog.papauschek.com/feed/", categories: []}, {url: "http://manuel.bernhardt.io/feed/", categories: []} ] 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 } } }) }…
  • 8. API: JSON validation Use case 
 classes case class Contributor( login: String, id: Long, avatar_url: String, … Add implicit Format 
 to the scope implicit val contributorFormat = Json.format[Contributor] Validate JSON 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 } ) }
  • 9. Talks: how to add your own Go 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!!!
  • 10. 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
  • 11. Talks: using markdown Add 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))
  • 12. MAKE IT BETTER COLLABORATORS WANTED!!!
  • 13. “The older I grow 
 the more I listen to people 
 who don't talk much.” – Germain G. Glien