We are about to switch to a new forum software. Until then we have removed the registration on this forum.
port twitter4j.conf.*;
import twitter4j.*;
import twitter4j.auth.*;
import twitter4j.api.*;
import java.util.*;
Twitter twitter;
String searchString = "Rest In Peace";
List<Status> tweets;
int currentTweet;
int offsetx, offsety;
PFont f;
//PImage img;
void setup()
{
f = loadFont("HelveticaNeue-Bold-90.vlw");
size(displayWidth, displayHeight);
// for twitter
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setOAuthConsumerKey("...");
cb.setOAuthConsumerSecret("...");
cb.setOAuthAccessToken("...");
cb.setOAuthAccessTokenSecret("...");
TwitterFactory tf = new TwitterFactory(cb.build());
twitter = tf.getInstance();
getNewTweets();
currentTweet = 0;
}
void draw()
{
background(255);
textAlign (CENTER, TOP);
textFont(f, 90);
currentTweet = currentTweet + 1;
if (currentTweet >= tweets.size())
{
print("getting new tweets");
currentTweet = 0;
getNewTweets();
}
Status status = tweets.get(currentTweet);
fill(0);
text(status.getText(), 0, 200, displayWidth, displayHeight);
delay(1000);
}
void getNewTweets()
{
try
{
Query query = new Query(searchString);
QueryResult result = twitter.search(query);
tweets = result.getTweets();
}
catch (TwitterException te)
{
System.out.println("Failed to search tweets: " + te.getMessage());
System.exit(-1);
}
//going to print out new tweets
int curt = 0;
for(int i=0; i< tweets.size(); i++){
Status status = tweets.get(curt);
print(status.getText() + "\n");
curt = curt + 1;
}
}
void refreshTweets()
{
while (true)
{
getNewTweets();
println("Updated Tweets");
delay(30000);
}
}
I would like to get and display the complete tweets with out the user handle and without an html code showing up right now it looks like this
Answers
Isn't that already what you're showing?
Don't post your Twitter credentials on a public message board.