开发者

How do you set the twitter user location in JTwitter?

I'm building some basic Twitter functionality into my app, and am using the JTwitter JAR to read and set status.

It looks like there is a User class that can be used to set the location, but I just can't figure out how to set it with my GPS coordinates once I've got my T开发者_如何学JAVAwitter object.

Has anyone been able to set the user.location property using JTwitter?

Thanks, -Gregg


Sorry for the omission!

I've just added support for setting your location to the latest version (v1.6.2). See Twitter.setMyLocation().

NB - location based searches are handled separately via setSearchLocation(), as they need long, lat and radius.


It would appear that JTwitter doesn't support this.

The Twitter API method /statuses/update takes lat and long arguments (or a single place_id argument) to specify the location.

Looking at the source (line ~2500), the updateStatus method of JTwitter only passes the status, source and in_reply_to_status_id arguments. You'll need to modify the JTwitter source to pass the lat/long arguments if you want to geotag your tweets.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜