緯度
private static final Double LATITUDE = 35.658517;
経度
private static final Double LONGITUDE = 139.701334;
@param args
public static void main(String[] args) {
TwitterFactory factory = new TwitterFactory();
Twitter twitter = factory.getInstance();
twitter.setOAuthConsumer(Const.CUNSUMER_KEY, Const.CUNSUMER_SECURITY);
twitter.setOAuthAccessToken(
new AccessToken(Const.ACCOUNT_TOKEN, Const.ACCOUNT_TOKEN_SECURITY));
final GeoLocation location = new GeoLocation(LATITUDE, LONGITUDE);
final String message = "Hello Twitter from Shibuya Station!";
StatusUpdate statusUpdate = new StatusUpdate(message);
statusUpdate.setDisplayCoordinates(true);
statusUpdate.setLocation(location);
try {
twitter.updateStatus(statusUpdate);
} catch (TwitterException e) {
e.printStackTrace();
}
}