twitter - Twitter4j Exception with track and geolocation -
i trying tweets either word "python" in or ones around city
this code:
statuslistener listener = new mystatuslistener(twitter); twitterstream.addlistener(listener); filterquery query = new filterquery(); string[] arr = { "python" }; double lat = 18.5203; double lon = 73.8567; double[][] locations = { { lat, lon } }; // pune city query.track(arr); query.locations(locations); twitterstream.filter(query); when run next exception:
returned streaming api when 1 or more of parameters not suitable resource. track parameter, example, throw error if: track keyword long or short. bounding box specified invalid. no predicates defined filtered resource, example, neither track nor follow parameter defined. follow userid cannot read. location track items must given pairs of comma separated lat/longs: [ljava.lang.string;@405ef8c2 [thu jun 26 19:06:58 gmt+05:30 2014]parameter not accepted role. 406:returned search api when invalid format specified in request. returned streaming api when 1 or more of parameters not suitable resource. track parameter, example, throw error if: track keyword long or short. bounding box specified invalid. no predicates defined filtered resource, example, neither track nor follow parameter defined. follow userid cannot read. location track items must given pairs of comma separated lat/longs: [ljava.lang.string;@405ef8c2 i same message in pair. if remove locations condition, code works fine. not sure issue here. can help please?
that bad. assuming if dont provide pair, twitter assume radius (like on web ui- near city). guess have provide bounding box. giving bounding box worked me.
twitter twitter4j
No comments:
Post a Comment