This file contains hidden or 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.sportsnetwork.stream.models | |
| import akka.actor.{ ActorSystem, Props } | |
| import play.api.libs.iteratee._ | |
| import play.api.libs.json._ | |
| import play.api.Logger | |
| import com.redis._ |
This file contains hidden or 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
| name := "tsn-api-live" | |
| version := "1.0-SNAPSHOT" | |
| libraryDependencies ++= Seq( | |
| jdbc, | |
| anorm, | |
| cache, | |
| "net.debasishg" % "redisclient_2.10" % "2.11" | |
| ) |
This file contains hidden or 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
| html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> | |
| <title>Error 500 No AtmosphereHandler found.</title> | |
| </head> | |
| <body><h2>HTTP ERROR 500</h2> | |
| <p>Problem accessing /the-chat. Reason: | |
| <pre> No AtmosphereHandler found.</pre></p><h3>Caused by:</h3><pre>org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler found. | |
| at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:190) | |
| at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:167) |
This file contains hidden or 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._ | |
| import Keys._ | |
| import org.scalatra.sbt._ | |
| import org.scalatra.sbt.PluginKeys._ | |
| import com.mojolly.scalate.ScalatePlugin._ | |
| import ScalateKeys._ | |
| object AtmosphereBuild extends Build { | |
| val Organization = "com.example" | |
| val Name = "Scalatra Atmosphere Example" |
This file contains hidden or 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
| {13-10-09 15:14}[2.0.0-p247]normandy:~/Projects/streaming sf% ruby atmosphere_test.rb | |
| <!-- ---------------------------------------------------------------- http://github.com/Atmosphere ------------------------------------------------------------------------ --> | |
| <!-- Welcome to the Atmosphere Framework. To work with all the browsers when suspending connection, Atmosphere must output some data to makes WebKit based browser working.--> | |
| <!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> | |
| <!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> | |
| <!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> | |
| <!-- --------------------------------------------------------- |
This file contains hidden or 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
| error { | |
| case e => { | |
| val logger = LoggerFactory.getLogger(getClass) | |
| logger.info("an exception occurred: " + e.printStackTrace()) | |
| //logger.info("the request body is: " + request) | |
| NotFound("An error occurred, please contact [email protected]") | |
| } | |
| } |
This file contains hidden or 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
| [ | |
| { | |
| "game_id": 3862, | |
| "gametime": "2013-12-02T13:00:00.000Z", | |
| "datetime": "2013-12-02T13:25:21.000Z", | |
| "seq_id": 10, | |
| "details": { | |
| "location": "Soldier Field", | |
| "status": "IP", | |
| "quarter": "1", |
This file contains hidden or 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
| object InjuryTester { | |
| implicit val dateRW = new BSONReader[BSONDateTime,Date] with BSONWriter[Date,BSONDateTime] { | |
| def read(bson: BSONDateTime): Date = new Date(bson.value) | |
| def write(date: Date): BSONDateTime = BSONDateTime(date.getTime) | |
| } | |
| implicit val pijHandler = Macros.handler[PlayerInjury] | |
| implicit val ijHandler = Macros.handler[Injury2] |
This file contains hidden or 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.sportsnetwork.api.models | |
| import com.sportsnetwork.api.dao._ | |
| import java.util.Date | |
| import com.mongodb.casbah.Imports._ | |
| import com.novus.salat._ | |
| import com.novus.salat.global._ | |
| import org.json4s.CustomSerializer | |
| import org.json4s._ | |
| import org.slf4j.{Logger, LoggerFactory} |