我正在从一个iOS应用程序获取用户的时间线,从API中检索了大量推文。我正在使用 statuses/user_timeline
端点获取数据,但由于我在移动设备上,并且我只需要推文文本,因此我想仅过滤推文的实际文本数据。我已经将 include_entities
设置为 no
,并将 trim_user
设置为 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
键?目前,这种方法非常低效。