Ruby 推特创业板-如何获得用户';什么国家?
我知道Twitter上的用户名。如何使用Twitter gem获取用户所在国家/地区?这是第一个: 然而,Ruby 推特创业板-如何获得用户';什么国家?,ruby,twitter,gem,Ruby,Twitter,Gem,我知道Twitter上的用户名。如何使用Twitter gem获取用户所在国家/地区?这是第一个: 然而,location只是一个字符串。用户的国家/地区没有显式存储 这是第一次: 然而,location只是一个字符串。用户的国家/地区没有显式存储 用户对象保存国家信息 "user":{"statuses_count":3080, "favourites_count":22, "protected":false, "profile_text_color":"437792", "prof
location
只是一个字符串。用户的国家/地区没有显式存储 这是第一次:
然而,
location
只是一个字符串。用户的国家/地区没有显式存储 用户对象保存国家信息
"user":{"statuses_count":3080, "favourites_count":22, "protected":false,
"profile_text_color":"437792", "profile_image_url":"...", "name":"Twitter API",
"profile_sidebar_fill_color":"a9d9f1", "listed_count":9252, "following":true,
"profile_background_tile":false, "utc_offset":-28800, "description":"The Real Twitter API.
I tweet about API changes, service issues and happily answer questions about Twitter and
our API. Don't get an answer? It's on my website.", "location":"San Francisco, CA",
"contributors_enabled":true, "verified":true, "profile_link_color":"0094C2",
"followers_count":665829, "url":"http:\/\/dev.twitter.com", "default_profile":false,
"profile_sidebar_border_color":"0094C2", "screen_name":"twitterapi",
"default_profile_image":false, "notifications":false, "display_url":null,
"show_all_inline_media":false, "geo_enabled":true, "profile_use_background_image":true,
"friends_count":32, "id_str":"6253282", "entities":{"hashtags":[], "urls":[],
"user_mentions":[]}, "expanded_url":null, "is_translator":false, "lang":"en",
"time_zone":"Pacific Time (US & Canada)", "created_at":"Wed May 23 06:01:13 +0000
2007", "profile_background_color":"e8f2f7", "id":6253282, "follow_request_sent":false,
"profile_background_image_url_https":"...", "profile_background_image_url":"...",
"profile_image_url_https":"..."}
它也可以由坐标对象来确定——如果你想使用地图服务来尝试确定纬度和经度线在哪个国家放置推文,或者你可以描绘一个国家的各个角落来尝试获得一个大致的想法。例如,您可以使用
明尼苏达州西北角最北端(北纬49°23'4.1英寸)
佛罗里达州最南端(北纬24°31′15〃)
最东端的赛欧岩,就在缅因州西库迪海的近海
(66°57'西)
从阿拉瓦角离岸的最西端波德尔泰岛,
华盛顿(西124°46'W)
由于48个相邻的US表示,places对象和users对象的位置通常为空或在实践中未指定:
"coordinates":
{
"coordinates":
[
-75.14310264,
40.05701649
],
"type":"Point"
}
或者最后通过places对象
"place":
{
"attributes":{},
"bounding_box":
{
"coordinates":
[[
[-77.119759,38.791645],
[-76.909393,38.791645],
[-76.909393,38.995548],
[-77.119759,38.995548]
]],
"type":"Polygon"
},
"country":"United States",
"country_code":"US",
"full_name":"Washington, DC",
"id":"01fbe706f872cb32",
"name":"Washington",
"place_type":"city",
"url": "http://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
}
用户对象保存国家信息
"user":{"statuses_count":3080, "favourites_count":22, "protected":false,
"profile_text_color":"437792", "profile_image_url":"...", "name":"Twitter API",
"profile_sidebar_fill_color":"a9d9f1", "listed_count":9252, "following":true,
"profile_background_tile":false, "utc_offset":-28800, "description":"The Real Twitter API.
I tweet about API changes, service issues and happily answer questions about Twitter and
our API. Don't get an answer? It's on my website.", "location":"San Francisco, CA",
"contributors_enabled":true, "verified":true, "profile_link_color":"0094C2",
"followers_count":665829, "url":"http:\/\/dev.twitter.com", "default_profile":false,
"profile_sidebar_border_color":"0094C2", "screen_name":"twitterapi",
"default_profile_image":false, "notifications":false, "display_url":null,
"show_all_inline_media":false, "geo_enabled":true, "profile_use_background_image":true,
"friends_count":32, "id_str":"6253282", "entities":{"hashtags":[], "urls":[],
"user_mentions":[]}, "expanded_url":null, "is_translator":false, "lang":"en",
"time_zone":"Pacific Time (US & Canada)", "created_at":"Wed May 23 06:01:13 +0000
2007", "profile_background_color":"e8f2f7", "id":6253282, "follow_request_sent":false,
"profile_background_image_url_https":"...", "profile_background_image_url":"...",
"profile_image_url_https":"..."}
它也可以由坐标对象来确定——如果你想使用地图服务来尝试确定纬度和经度线在哪个国家放置推特,或者你可以描绘一个国家的各个角落来尝试获得一个大致的想法。例如,你可以使用
明尼苏达州西北角最北端(北纬49°23'4.1英寸)
佛罗里达州最南端(北纬24°31′15〃)
最东端的赛欧岩,就在缅因州西库迪海的近海
(66°57'西)
从阿拉瓦角离岸的最西端波德尔泰岛,
华盛顿(西124°46'W)
由于48个相邻的US表示,places对象和users对象的位置通常为空或在实践中未指定:
"coordinates":
{
"coordinates":
[
-75.14310264,
40.05701649
],
"type":"Point"
}
或者最后通过places对象
"place":
{
"attributes":{},
"bounding_box":
{
"coordinates":
[[
[-77.119759,38.791645],
[-76.909393,38.791645],
[-76.909393,38.995548],
[-77.119759,38.995548]
]],
"type":"Polygon"
},
"country":"United States",
"country_code":"US",
"full_name":"Washington, DC",
"id":"01fbe706f872cb32",
"name":"Washington",
"place_type":"city",
"url": "http://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
}