• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Scala Vienna Website: reloaded
 

Scala Vienna Website: reloaded

on

  • 256 views

 

Statistics

Views

Total Views
256
Views on SlideShare
256
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Scala Vienna Website: reloaded Scala Vienna Website: reloaded Presentation Transcript

    • SCALA VIENNA WEBAPP RELOADED Felix Amerbauer, @felixamerbauer Nikolay Kushin, @zikolach
    • Wanted to DO it
    • What we use
    • Scala Posts Contributors Tweet timeline Events and Photos Integration
    • SOME BORING TECH DETAILS
    • 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!!!
    • 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 } } }) }…
    • 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 } ) }
    • 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!!!
    • 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 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))
    • MAKE IT BETTER COLLABORATORS WANTED!!!
    • “The older I grow 
 the more I listen to people 
 who don't talk much.” – Germain G. Glien