2013-04-13 61 views
1

我試圖用Twitter的地理標記

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" 
} 

回答

0

根據Twitter的文檔中,位置參數接受逗號分隔經度的列表,緯度對指定一組的包圍盒。

如果您只傳入一個經緯度,那麼它會將最近的推文返回到該位置。你是否還指定了一個過濾器查詢,如果是的話,這將大大減少返回的Tweets數量,這意味着離倫敦最近的Tweet,實際上是數英里之遙。我有類似的問題。如上所述,我只是試過了,如果你使用下面的緯度和經度,沒有其他過濾器查詢它的效果很好。

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

還有一點要注意,是不是有很多的鳴叫的實際附上的位置了,而且往往裏面做的那些非常不準確的,因爲它們實際上可以從指定的作者歸屬位置來自己個人資料。