if(collection != null){
int vc = collection.size();
for(int i = 0; i < vc; i++) {
Object o = collection.get(i);
if(o != null){
JsonNavigator nav = new JsonNavigator(o);
TwitterEntry entry = new TwitterEntry();
//entry.setTweetContent(nav.stringValue("text"));
entry.setTitle(nav.stringValue("text"));
entry.setAuthor(nav.get("user").stringValue("name"));
entries.add(entry);
}
}
}
}
else{
//TODO change this to JSON to be consistent
//http://search.twitter.com/search.json?q=%40twitterapi
ClientService svc = createClientService(provider, "search.json");
if(hashTag.indexOf('#') != 0){
hashTag = "#" + hashTag;
}
params.put("q", hashTag);
//TODO - Padraic
HandlerJson json= new HandlerJson();
ArrayList collection = (ArrayList)svc.get(null,params, json).getData();
if(collection != null){
int vc = collection.size();
for(int i = 0; i < vc; i++) {
Object o = collection.get(i);
if(o != null){
JsonNavigator nav = new JsonNavigator(o);
TwitterEntry entry = new TwitterEntry();
//entry.setTweetContent(nav.stringValue("text"));
entry.setTitle(nav.stringValue("text"));
entry.setAuthor(nav.get("user").stringValue("name"));
entries.add(entry);
}
}
}