a few tweet stream questions
in
Contributed Library Questions
•
3 years ago
Hello,
I am trying to learn to use the tweet stream library. Is that library going to not work soon because of what's said in this post?
Anyway, below is a very, very simple program where a random dot is placed on the screen every time a certain word is tweeted. If the word being searched is just "the" or "a" I get a lot of dots being drawn. However, if I use something like a trending topic (i.e- #ismilewhen or ismilewhen or bb11 (big brother11)) or anything like that, I get maybe 3-5 dots in the course of a few minutes whereas on search.twitter.com I see that these words are being tweeted 100s of times a minute. Is it in my programming or is it the library?
Also, could I just use the java twitter4j library? How would I place that in my Processing library folder? I put it in there and imported all the libraries, trying to run this sketch on my PC but it didn't work.
So here is the little program. Thanks so much for any help!!!!
I am trying to learn to use the tweet stream library. Is that library going to not work soon because of what's said in this post?
Anyway, below is a very, very simple program where a random dot is placed on the screen every time a certain word is tweeted. If the word being searched is just "the" or "a" I get a lot of dots being drawn. However, if I use something like a trending topic (i.e- #ismilewhen or ismilewhen or bb11 (big brother11)) or anything like that, I get maybe 3-5 dots in the course of a few minutes whereas on search.twitter.com I see that these words are being tweeted 100s of times a minute. Is it in my programming or is it the library?
Also, could I just use the java twitter4j library? How would I place that in my Processing library folder? I put it in there and imported all the libraries, trying to run this sketch on my PC but it didn't work.
So here is the little program. Thanks so much for any help!!!!
- import com.twitter.processing.*;
String tweetText = "";
String search = "the";
int counter;
void setup() {
size(800,800);
background(0);
TweetStream s = new TweetStream(this, "stream.twitter.com", 80, "1/statuses/sample.json", "THISISMYUSERNAME", "THISISMYPASSWORD"); //// what does that 80 mean?
s.go(); ///////what does this s.go(); mean?
}
void draw() {
int index = tweetText.indexOf(search);
if (index >= 0) {
ellipse(random(800), random(800), 20, 20);
}
}
void tweet(Status tweet) {
tweetText = tweet.text();
}
4