Merge pull request #166 from rjurney/master

Fixed auth problem with twitter example
This commit is contained in:
cheddar 2013-06-13 22:17:32 -07:00
commit c7274f2fbc
3 changed files with 22 additions and 10 deletions

View File

@ -13,10 +13,16 @@ if [ ! -e "$PF" ]; then
touch created
touch $PF
chmod 700 $PF
echo " Your twitter user login name and pw is needed "
read -p 'twitter username? ' TWIT_USER
read -s -p 'twitter password? ' TWIT_PW
echo "user=${TWIT_USER}" >> $PF
echo "password=${TWIT_PW}" >> $PF
TWIT_PW=""
echo " Your twitter OAuth information is needed. Go to https://twitter.com/oauth_clients/new to register a new application and retrieve your keys "
read -p 'Twitter consumer key? ' CONSUMER_KEY
read -p 'Twitter consumer secret? ' CONSUMER_SECRET
read -p 'Twitter access token? ' ACCESS_TOKEN
read -p 'Twitter access token secret? ' ACCESS_TOKEN_SECRET
echo "debug=true" >> $PF
echo "oauth.consumerKey=${CONSUMER_KEY}" >> $PF
echo "oauth.consumerSecret=${CONSUMER_SECRET}" >> $PF
echo "oauth.accessToken=${ACCESS_TOKEN}" >> $PF
echo "oauth.accessTokenSecret=${ACCESS_TOKEN_SECRET}" >> $PF
CONSUMER_SECRET=""
ACCESS_TOKEN_SECRET=""
fi

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);