I am using TwitterSource for Flume from Cloudera. I want to get tweets by country with certain keywords. I'm not sure what to compare to when I want to get tweets from The Netherlands. I have the following which results in nothing being processed:
public void onStatus(Status status) {
if(status.getPlace().getCountry().equalsIgnoreCase("netherlands")) {
headers.put("timestamp", String.valueOf(status.getCreatedAt().getTime()));
Event event = EventBuilder.withBody(DataObjectFactory.getRawJSON(status).getBytes(), headers);
channel.processEvent(event);
}
}
The reason I don't use FilterQuery for this is because I want to use this for keywords. If I combine this it would be logical OR and not AND.
FilterQuery query = new FilterQuery().track(keywords);