本文整理了Java中twitter4j.Twitter.searchPlaces()
方法的一些代码示例,展示了Twitter.searchPlaces()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Twitter.searchPlaces()
方法的具体详情如下:
包路径:twitter4j.Twitter
类名称:Twitter
方法名:searchPlaces
暂无
代码示例来源:origin: org.twitter4j/twitter4j-async
@Override
public void invoke(List<TwitterListener> listeners) throws TwitterException {
ResponseList<Place> places = twitter.searchPlaces(query);
for (TwitterListener listener : listeners) {
try {
listener.searchedPlaces(places);
} catch (Exception e) {
logger.warn("Exception at searchPlaces", e);
}
}
}
});
代码示例来源:origin: openimaj/openimaj
private String searchWithTwitter(String location) throws EnforcedWaitException {
while(true){
try {
twitterLastCall.enforce();
ResponseList<Place> res = this.twitter.searchPlaces(new GeoQuery(location));
if(res.size() > 0)
return res.get(0).getCountryCode();
else
return null;
} catch (TwitterException e) {
this.twitterLastCall.currentWait = Twitter4jUtil.handleTwitterException(e, TWITTER_DEFAULT_ERROR_BUT_NO_WAIT_TIME);
throw new EnforcedWaitException(this.twitterLastCall);
}
}
}
代码示例来源:origin: org.openimaj.tools/TwitterPreprocessingTool
private String searchWithTwitter(String location) throws EnforcedWaitException {
while(true){
try {
twitterLastCall.enforce();
ResponseList<Place> res = this.twitter.searchPlaces(new GeoQuery(location));
if(res.size() > 0)
return res.get(0).getCountryCode();
else
return null;
} catch (TwitterException e) {
this.twitterLastCall.currentWait = Twitter4jUtil.handleTwitterException(e, TWITTER_DEFAULT_ERROR_BUT_NO_WAIT_TIME);
throw new EnforcedWaitException(this.twitterLastCall);
}
}
}
代码示例来源:origin: org.mule.modules/mule-module-twitter
/**
* Search for places that can be attached to a statuses/update. Given a latitude
* and a longitude pair, or and IP address, this request will return a list of
* all the valid places that can be used as the place_id when updating a status.
* <p/>
* {@sample.xml ../../../doc/twitter-connector.xml.sample twitter:searchPlaces}
*
* @param latitude latitude coordinate. Mandatory if ip is not specified
* @param longitude longitude coordinate.
* @param ip the ip. Mandatory if coordinates are not specified
* @return a {@link ResponseList} of {@link Place}
* @throws TwitterException when Twitter service or network is unavailable
*/
@Processor
public ResponseList<Place> searchPlaces(@Placement(group = "Coordinates") @Optional Double latitude,
@Placement(group = "Coordinates") @Optional Double longitude,
@Optional String ip) throws TwitterException {
return getConnectionManagement().getTwitterClient().searchPlaces(createQuery(latitude, longitude, ip));
}
内容来源于网络,如有侵权,请联系作者删除!