Upgraded to twitter4j 3.0.3, twitter example now works with twitter4j.properties in place that lists key pairs.

This commit is contained in:
Russell Jurney 2013-06-13 17:59:17 -07:00
parent b96d6b3546
commit 58780094a9
2 changed files with 10 additions and 4 deletions

View File

@ -125,17 +125,17 @@
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>2.2.6</version>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-async</artifactId>
<version>2.2.6</version>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-stream</artifactId>
<version>2.2.6</version>
<version>3.0.3</version>
</dependency>
<!-- Tests -->

View File

@ -17,6 +17,7 @@ import twitter4j.StatusListener;
import twitter4j.TwitterStream;
import twitter4j.TwitterStreamFactory;
import twitter4j.User;
import twitter4j.StallWarning;
import java.io.IOException;
import java.util.Arrays;
@ -31,7 +32,7 @@ import java.util.concurrent.TimeUnit;
import static java.lang.Thread.sleep;
/**
* Twitter "spritzer" Firehost Factory named "twitzer".
* Twitter "spritzer" Firehose Factory named "twitzer".
* Builds a Firehose that emits a stream of
* ??
* with timestamps along with ??.
@ -176,6 +177,11 @@ public class TwitterSpritzerFirehoseFactory implements FirehoseFactory {
{
ex.printStackTrace();
}
@Override
public void onStallWarning(StallWarning warning) {
System.out.println("Got stall warning:" + warning);
}
};
twitterStream.addListener(statusListener);