cogShow how to search for tweets
Developed by

Vincent Massol

Rating
LicenseGNU Lesser General Public License 2.1

Description

This example uses Twitter4J to search for tweets matching the "rivieraDEV" keyword.

{{groovy}}
@Grab(group='org.twitter4j', module='twitter4j-core', version='2.2.4')
import twitter4j.*;

Twitter twitter = new TwitterFactory().getInstance()
Query query = new Query("rivieraDEV")

println "|=User|=Message"
twitter.search(query).getTweets().each() {
    println "|${it.getFromUser()}|${it.getText()}"
}
{{/groovy}}

Result:

twitter-search.png

Prerequisites & Installation Instructions

Copy the code snippet to a page and save it.

Created by Vincent Massol on 2011/10/20 14:24
     

Get Connected