每次我在推文中搜索位置时,它都会返回 null,这是我的代码,有什么想法吗?
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setOAuthConsumerKey("8888888888888888888");
cb.setOAuthConsumerSecret("8888888888888888888888888");
cb.setOAuthAccessToken("8888888888888888888888");
cb.setOAuthAccessTokenSecret("8888888888888888888888888888");
Twitter twitter = new TwitterFactory(cb.build()).getInstance();
Query query = new Query("London");
query.setRpp(1000000);
QueryResult result = twitter.search(query);
ArrayList tweets = (ArrayList) result.getTweets();
for (int i = 0; i < tweets.size(); i++) {
Tweet t = (Tweet) tweets.get(i);
String user = t.getFromUser();
GeoLocation l = t.getGeoLocation();
String locNam = t.getLocation();
String msg = t.getText();
Date d = t.getCreatedAt();
println(locNam + "");
我可以getGeoLocation()
正常工作,它们很少而且相距甚远,但是我确实得到了一些,但是getLocation
每次搜索都返回null。
任何帮助,将不胜感激!干杯