use of twitter4j.Tweet in project aries by apache.
the class TwitterQuery method start.
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
Twitter twitter = new Twitter();
Query query = new Query("from:theasf");
try {
QueryResult result = twitter.search(query);
List<Tweet> tweets = result.getTweets();
System.out.println("hits:" + tweets.size());
for (Tweet tweet : tweets) {
System.out.println(tweet.getFromUser() + ":" + StringEscapeUtils.unescapeXml(tweet.getText()));
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations