snakked 0.3
Limitation: cannot see through collections or arrays so far.
Extended bean parsing by type. I.e. a tag name can be the type name expected. This only works for simple types and not for collections or arrays of type. It uses Class.getSimpleName()
case class C1 { val c=C2 }
case class C2 { val c=C3 }
case class C3 { val c="wow" }
@Test def test21 = expect("wow" :: Nil) { Snakk.bean(C1) \\ "C3" \@ "c" }updated to sbt 0.11
Razie's Snakked is a scala naked objects framework with a twist.
Why? So you can easily source and manipulate any data in the major formats, via the major protocols, among others.
Snakking
razie.Snakk gives simple methods to suck content from URLs, including files etc in a few formats.
List of blog titles from an XML and JSON feed:
val xmlFeed = url("http://feeds.razie.com/Razblog?format=xml")
val jsonFeed = url("http://blog.razie.com/feeds/posts/default?alt=json")
for (n <- xml(xmlFeed) \ "channel" \ "item" \ "title") println (n.text)
for (n <- json(jsonFeed) \ "feed" \ "entry" \ "title" \@ "$t") println (n)