Created
June 11, 2012 05:12
-
-
Save brunoborges/2908606 to your computer and use it in GitHub Desktop.
No #TDC2012 vc talvez aprenda a usar Scala, Apache Camel e o Twitter :-)
This file contains 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
class MyRouteBuilder extends RouteBuilder { | |
val tweetMsg = (e: Exchange) ⇒ { | |
val tweet = new StatusUpdate("@%s ei, se minha palestra for aceita, voce vai aprender como usar Scala, Apache Camel e Twitter!".format(status.getFromUser())) | |
tweet.setInReplyToStatusId(e.getIn.getBody.asInstanceOf[Tweet].getId()) | |
e.getIn().setBody(tweet) | |
} | |
"twitter://search?delay=10&type=polling&keywords=%23TDC2012%20scala%20camel%20twitter" ==> { | |
when(_.in.asInstanceOf[Tweet].getFromUser() != "brunoborges") { | |
process(tweetMsg) | |
to("twitter://timeline/user") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment