Friday, May 7, 2010

it's been a long time

In the meantime there was a new release of the library - download.


(logged to my test account to find out that the last activity was 4 months ago)

Another question posted to newsgroup here and here.

Just basic stuff, learning the API:

public class Main {
public static void main(String[] args) {
Twitter twitter = new TwitterFactory().getInstance(XXX, XXX);
try {
Query query = new Query("obama");
query.setGeoCode(new GeoLocation(50.0, 10.0), 1000.0, Query.KILOMETERS);
QueryResult result = twitter.search(query);

for (Tweet tweet : result.getTweets()) {
System.out.println(
tweet.getCreatedAt() +
" user: " + tweet.getFromUser().substring(0, 2) +
" text: " + tweet.getText().substring(0, 2) +
" loc: " + tweet.getGeoLocation()
);
}

} catch (TwitterException e) {
e.printStackTrace();
}
}
}


Some useful classes: Query, QueryResult

0 komentarze:

Post a Comment