Advertisement
Guest User

Untitled

a guest
Apr 1st, 2014
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.79 KB | None | 0 0
  1.   private def getGeoFromLastActivity(actorUUID: String, scoreId: String): Option[Map[String, String]] = {
  2.     getLastGNIPActivity(actorUUID, scoreId).flatMap(a => {
  3.       JSON.parseFull(a).flatMap(j => {
  4.         val raw = j.asInstanceOf[Map[String, Any]]
  5.         raw.get("gnip").flatMap(gnip => {
  6.           gnip.asInstanceOf[Map[String, Any]].get("profileLocations").flatMap(profileLocations => {
  7.             val p = profileLocations.asInstanceOf[List[Any]]
  8.             if(p.size > 0) {
  9.               val loc = p(0).asInstanceOf[Map[String, Any]]
  10.               loc.get("address").flatMap(address => {
  11.                 Some(address.asInstanceOf[Map[String, String]])
  12.               })
  13.             }
  14.             else {
  15.               None
  16.             }
  17.           })
  18.         })
  19.       })
  20.     })
  21.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement