1

我正在尝试使用从伦敦地区下载推文

curl --user xx:xx -X POST -d 'locations=-0.651,51.208,0.425,51.781' https://stream.twitter.com/1.1/statuses/filter.json > twitter.london.json

我收到的推文很离谱。例如在 (-6.71658144,50.48812681) 中。这是为什么?

推文:

{
    "created_at": "Mon Apr 08 12:26:40 +0000 2013",
    "id": 321237656321286144,
    "id_str": "321237656321286144",
    "text": "4dc9c54f70000000",
    "source": "\u003ca href=\"http:\/\/www.google.com\/\" rel=\"nofollow\"\u003eGoogle\u003c\/a\u003e",
    "truncated": false,
    "in_reply_to_status_id": null,
    "in_reply_to_status_id_str": null,
    "in_reply_to_user_id": null,
    "in_reply_to_user_id_str": null,
    "in_reply_to_screen_name": null,
    "user": {
        "id": 61043461,
        "id_str": "61043461",
        "name": "GooGuns",
        "screen_name": "googuns_prod",
        "location": "",
        "url": null,
        "description": null,
        "protected": false,
        "followers_count": 86,
        "friends_count": 0,
        "listed_count": 2,
        "created_at": "Tue Jul 28 22:49:22 +0000 2009",
        "favourites_count": 0,
        "utc_offset": -18000,
        "time_zone": "Eastern Time (US & Canada)",
        "geo_enabled": true,
        "verified": false,
        "statuses_count": 417708,
        "lang": "en",
        "contributors_enabled": false,
        "is_translator": false,
        "profile_background_color": "C0DEED",
        "profile_background_image_url": "http:\/\/a0.twimg.com\/images\/themes\/theme1\/bg.png",
        "profile_background_image_url_https": "https:\/\/si0.twimg.com\/images\/themes\/theme1\/bg.png",
        "profile_background_tile": false,
        "profile_image_url": "http:\/\/a0.twimg.com\/sticky\/default_profile_images\/default_profile_3_normal.png",
        "profile_image_url_https": "https:\/\/si0.twimg.com\/sticky\/default_profile_images\/default_profile_3_normal.png",
        "profile_link_color": "0084B4",
        "profile_sidebar_border_color": "C0DEED",
        "profile_sidebar_fill_color": "DDEEF6",
        "profile_text_color": "333333",
        "profile_use_background_image": true,
        "default_profile": true,
        "default_profile_image": true,
        "following": null,
        "follow_request_sent": null,
        "notifications": null
    },
    "geo": {
        "type": "Point",
        "coordinates": [50.48812681, -6.71658144]
    },
    * * "coordinates": {
        "type": "Point",
        "coordinates": [-6.71658144, 50.48812681]
    },
    * * "place": {
        "id": "6416b8512febefc9",
        "url": "http:\/\/api.twitter.com\/1\/geo\/id\/6416b8512febefc9.json",
        "place_type": "country",
        "name": "United Kingdom",
        "full_name": "United Kingdom",
        "country_code": "GB",
        "country": "United Kingdom",
        "contained_within": [],
        "geometry": null,
        "polylines": [],
        "bounding_box": {
            "type": "Polygon",
            "coordinates": [
                [
                    [-8.662663, 49.1626564],
                    [-8.662663, 60.86165],
                    [1.768926, 60.86165],
                    [1.768926, 49.1626564]
                ]
            ]
        },
        "attributes": {}
    },
    "contributors": null,
    "retweet_count": 0,
    "favorite_count": 0,
    "entities": {
        "hashtags": [],
        "urls": [],
        "user_mentions": []
    },
    "favorited": false,
    "retweeted": false,
    "filter_level": "medium",
    "lang": "en"
}
4

1 回答 1

0

根据 Twitter 文档,location 参数接受以逗号分隔的经度、纬度对列表,指定一组边界框。

如果您只传递一个纬度和经度,那么它将返回最近的推文到该位置。您是否还指定了过滤器查询,如果是这样,这将大大减少返回的推文数量,这意味着离伦敦最近的推文实际上在数英里之外。我有一个类似的问题。

话虽如此,我只是尝试了一下,如果您使用下面的 lat 和 lon,没有其他过滤器查询,它工作得很好。

{locations: [51.50,0.12,51.75,1.25]}

需要注意的另一点是,实际上已不再有很多推文附有位置,而且通常附有位置的推文非常不准确,因为它们实际上可能来自其个人资料中指定的作者家庭位置。

于 2015-09-28T20:21:02.867 回答