I'm trying to get a stream of public tweets using Hosebird (https://github.com/twitter/hbc), which I'm completely new to. I tried using their 'Quickstart' example, just to get an idea of what the streaming is like, so I copied the example code. The only changes I made were getting rid of the 'followings' variable, and filling in the proper OAuth information.
After connecting using hosebirdClient.connect()
, I added this code in an attempt to print one tweet:
String msg = null;
try {
msg = msgQueue.take();
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println(msg);
The code is free of errors, but then stays on the line String msg = msgQueue.take()
forever, instead of producing a tweet. Any ideas on what I'm doing wrong?
Copyright Notice:Content Author:「user」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30768350/streaming-tweets-with-hosebird