2011-06-08 101 views
0

我试图获取帐户的时间线并显示它。我正在使用亚伯拉罕威廉姆斯认证库。该程序现在显示推文,但我无法弄清楚如何获得相应的图像。我查看了Twitter的文档,并且该信息在xml文件中返回。我使用的库返回一个对象数组。我遍历每一个并调用显示推文文本的文本方法。我无法在对象中找到与每个图像的url有关的任何方法。Twitter api,试图弄清楚如何从time_line获取用户图片url,可以获取文本

$home_timeline = $oauth->get('statuses/home_timeline',array('count' => 40)); 
// print_r($home_timeline); 
foreach ($home_timeline as $status) 
    // can get the text but not the image url 
    echo "Tweet: $status->text"; 

回答

0

如果您正在寻找要显示的用户发布的微博的个人资料图片,然后抓住从每个嵌入式user对象profile_image_url属性status对象中,像这样:

$status->user->profile_image_url