我从 iOS 应用程序中获取用户的时间线,从 API 中提取了大量推文。但是,我正在使用statuses/user_timeline
端点获取数据,因为我在移动设备上并且只需要推文文本,因此我只想过滤推文的实际文本数据。我已经设置include_entities
了 tono
和trim_user
to true
,但是即使删除了实体和用户数据,我仍然会得到很多我不需要的数据。这是我从端点获得的示例推文:
{
"created_at": "Tue Nov 27 14:13:13 +0000 2012",
"id": 273429272209801200,
"id_str": "273429272209801217",
"text": "you could list #5ThingsIFindAttractive but you can actually find them on Facebook with Social Match on iPhone! http://t.co/zRr1ggbz",
"source": "web",
"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": 62828168,
"id_str": "62828168"
},
"geo": null,
"coordinates": null,
"place": {
"id": "682c5a667856ef42",
"url": "http://api.twitter.com/1/geo/id/682c5a667856ef42.json",
"place_type": "country",
"name": "Turkey",
"full_name": "Turkey",
"country_code": "TR",
"country": "Turkey",
"bounding_box": {
"type": "Polygon",
"coordinates": [
[
[
25.663883,
35.817497
],
[
44.822762,
35.817497
],
[
44.822762,
42.109993
],
[
25.663883,
42.109993
]
]
]
},
"attributes": {}
},
"contributors": null,
"retweet_count": 0,
"favorited": false,
"retweeted": false,
"possibly_sensitive": false
}
我真正需要的是text
字典的键。其余的目前对我的应用程序没用。我会请求很多这样的推文。如何发送请求以text
获取推文的密钥?目前,这种方法效率极低。