You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.
yes.. i got track from user stream on HBC, plz confirm this code is right or wrong, because i am new user of hbc. This is working code, I got right result, with keyword search. plz just confirm my approach is right or wrong or it may give some problem in certain scenario. thank you.
public class UserStreamExample
{
public static void oauth(String consumerKey, String consumerSecret, String token, String secret) throws InterruptedException
{
BlockingQueue queue = new LinkedBlockingQueue(10000);
UserstreamEndpoint endpoint = new UserstreamEndpoint();
endpoint.addQueryParameter("track","farah");
Authentication auth = new OAuth1(consumerKey, consumerSecret, token, secret);
// Create a new BasicClient. By default gzip is enabled.
Client client = new ClientBuilder()
.hosts(Constants.USERSTREAM_HOST)
.endpoint(endpoint)
.authentication(auth)
.processor(new StringDelimitedProcessor(queue))
.build();
// Establish a connection
client.connect();
// Do whatever needs to be done with messages
for (int msgRead = 0; msgRead < 1000; msgRead++) {
String msg = queue.take();
System.out.println(msg);
}
client.stop();
}
public static void main(String[] args) {
try {
UserStreamExample.oauth(args[0], args[1], args[2], args[3]);
} catch (InterruptedException e) {
System.out.println(e);
}
}
}
The text was updated successfully, but these errors were encountered:
yes.. i got track from user stream on HBC, plz confirm this code is right or wrong, because i am new user of hbc. This is working code, I got right result, with keyword search. plz just confirm my approach is right or wrong or it may give some problem in certain scenario. thank you.
public class UserStreamExample
{
public static void oauth(String consumerKey, String consumerSecret, String token, String secret) throws InterruptedException
{
BlockingQueue queue = new LinkedBlockingQueue(10000);
}
The text was updated successfully, but these errors were encountered: