1

我正在使用 Python 通过 API 流式传输 Twitter 的推文。例如,单词“car”会生成以下结果:

{
    "created_at": "Fri Sep 05 00:15:32 +0000 2014",
    "id": 507683414255108096,
    "id_str": "507683414255108096",
    "text": "I put 'or nah' in my cousins car and Brenda & I are singing along a",
    "source": "\u003ca href=\"http:\/\/www.cloudhopper.com\/\" rel=\"nofollow\"\u003eCloudhopper\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": 84729292,
        "id_str": "84729292",
        "name": "Tracy Ochoa",
        "screen_name": "TracyMayy",
        "location": "",
        "url": "http:\/\/whythefuckinfucknot.tumblr.com",
        "description": "New York 16 Instagram - TracyMayy Tumblr - http:\/\/whythefuckinfucknot.tumblr.com http:\/\/ask.fm\/tracyochoa",
        "protected": false,
        "verified": false,
        "followers_count": 1045,
        "friends_count": 453,
        "listed_count": 22,
        "favourites_count": 46035,
        "statuses_count": 44720,
        "created_at": "Sat Oct 24 00:42:23 +0000 2009",
        "utc_offset": -14400,
        "time_zone": "Eastern Time (US & Canada)",
        "geo_enabled": true,
        "lang": "en",
        "contributors_enabled": false,
        "is_translator": false,
        "profile_background_color": "000000",
        "profile_background_image_url": "http:\/\/pbs.twimg.com\/profile_background_images\/497215144607236096\/AharMORU.png",
        "profile_background_image_url_https": "https:\/\/pbs.twimg.com\/profile_background_images\/497215144607236096\/AharMORU.png",
        "profile_background_tile": true,
        "profile_link_color": "000000",
        "profile_sidebar_border_color": "FFFFFF",
        "profile_sidebar_fill_color": "09B6D9",
        "profile_text_color": "050505",
        "profile_use_background_image": true,
        "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/504330955637919745\/JAHlbkiS_normal.jpeg",
        "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/504330955637919745\/JAHlbkiS_normal.jpeg",
        "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/84729292\/1409681919",
        "default_profile": false,
        "default_profile_image": false,
        "following": null,
        "follow_request_sent": null,
        "notifications": null
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "retweet_count": 0,
    "favorite_count": 0,
    "entities": {
        "hashtags": [],
        "trends": [],
        "urls": [],
        "user_mentions": [],
        "symbols": []
    },
    "favorited": false,
    "retweeted": false,
    "possibly_sensitive": false,
    "filter_level": "medium",
    "lang": "en",
    "timestamp_ms": "1409876132921"
}

在我看来,写这条推文的 Twitter 用户的 ID 为“507683414255108096”,有没有办法用写相应推文的实际 Twitter 用户的用户名导出 Twitter 的 API 推文?

如果不通过 API,我是否需要真正关注人们以获取带有用户名的推文流?或者还有其他方法吗?

4

0 回答 0