2012-12-21 33 views
3

我从iOS应用程序获取用户的时间线,并从API中获取大量推文。我使用statuses/user_timeline端点来获取数据,但是,因为我在移动设备上,而且我只需要tweet文本,所以我只想过滤推文的实际文本数据。我已经设定include_entitiesnotrim_usertrue,但即使有实体和用户数据修剪掉,我还是得到了很多,我并不需要的数据。下面是一个简单的鸣叫,我从端点获得:从Twitter获取用户时间轴的选定字段

{ 
"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键?目前,这种方法是极其低效的

回答

1

你不能。您可以做的最好的办法是设置一个代理,它将请求数据,将其剥离,然后转发给移动设备。

如果它的任何安慰的JSON将gzip压缩的,所以应该还是比较小 - 所以不会花太长时间转让或者吃用户的数据额度。

+0

好吧,我将使用gzip压缩的数据,这将是最适合我的情况..伤心地看到,没有了Facebook的图形/ FQL API,在这里我们选择,我们只需要等领域的等价物。 –

相关问题