Has anybody any ideas on how to reply to a tweet using Twitter4j?
I want to be able for search for tweets, and when I find these tweets, I want to be able to reply to a particular tweet.
Say I'm searching for tweets with the work 'ProcessingForum'. I search for these tweets, and get the ScreenName by using getScreenName();. I can send tweets to anybody who has tweeted something with the string 'ProcessingForum', but I want to be able to
reply to the particular tweet that has mentioned 'ProcessingFroum'.
Any Ideas?
Some code below that shows how I'm doing it so far
String sendto = ""; ///////string to store the ScreenName
void setup() {
size(100,100);
background(0);
connectTwitter();
getTimeline(); //gets tweets from my timeline
getSearchTweets(); //gets any tweets with the defined string ///get the screen name before I send the tweet\\\\\
sendTweet("@"+ sendto + " You just tweeted about arsejesustweeting, you pup! (attempt #5)");
}
void getSearchTweets() { //search for all tweets
String queryStr = "ProcessingForum";
try {
Query query = new Query(queryStr);
query.count(10); // Get 10 of the 100 search results
Hi, I'm trying to display two Strings of text along two different curves in a sketch.
I'm bringing tweets in from an excel sheet thats 100 rows in length, and I want the first 50 to display off/around one circle and the next fifty to display off/around a second circle. I can do the first fifty alright, but I can't get the second lot to display around the second ellipse that I've drawn.
The code I've included is a slimmed down version of the code that I'm working with (the code I'm working with is a bit messy and long) but if I get it working on a basic level I can transfer it over.
Any and all help will be greatly appreciated!
Martin
// The message to be displayed
String message = "text";
String message2 = "aaaa";
PFont f;
// The radius of a circle
float r = 100;
float q = r*2;
float r2 = 100;
float q2 = r2*2;
void setup() {
size(800, 800);
f = createFont("Georgia",40,true);
textFont(f);
// The text must be centered!
textAlign(CENTER);
smooth();
}
void draw() {
background(255);
// Start in the center and draw the circle
translate(width / 2, height / 2);
noFill();
stroke(0);
ellipse(00, 00, r*2, r*2);
ellipse (100, 50, r2*2, r2*2);
// We must keep track of our position along the curve
float arclength = 0;
float arclength2 = 0;
// Instead of a constant width, we check the width of each character.
//char currentChar = message.charAt(i);
float w = textWidth(message);
float w2 = textWidth(message2);
// Each box is centered so we move half the width
arclength += w/2;
arclength += w2/2;
// Angle in radians is the arclength divided by the radius
// Starting on the left side of the circle by adding PI
float theta = PI + arclength / r;
float theta2 = PI + arclength2 / r2;
pushMatrix();
// Polar to cartesian coordinate conversion
translate(r*cos(theta), r*sin(theta));
translate(r2*cos(theta2), r2*sin(theta2));
// Rotate the box
rotate(theta+PI/1); // rotation is offset by 90 degrees