2014-10-02 107 views
0

我不知道一切是如何获得的Twitter帐户的配置文件的化身:/ 即使看DOC这里: https://dev.twitter.com/rest/reference/post/account/update_profile_image 如果一个善良的人能帮助我。 这里是没有阶级API的Twitter帐户1.1/update_profile_image

if(isset($_GET['name'])) 
{ 
$name= htmlentities($_GET['name']); 
} 

$cache = 'cache/tweets.tmp'; 
     if(time() - filemtime($cache) > 60){ 
     require 'class/twitteroauth.php'; 
     $connection = new TwitterOAuth('***','****', '**-**', '****'); 
     $pics = $connection->post('account/update_profile_image','//screen_name => HERE...$name....'); 
     //var_dump($pics); 
     file_put_contents($cache, serialize($pics)); 
     }else{ 
     echo 'Cache utilisé'; 
     $pics = unserialize(file_get_contents($cache)); 
     } 

回答

1

您正在寻找更新Twitter用户的个人资料图片的文档我的代码。从你的问题,我认为你只是想获得这个形象。请记住POST请求是为了创建新内容,而不是简单的GET

看一看这样的:
https://dev.twitter.com/rest/reference/get/users/show

users/show方法提供有关用户的各种信息,包括连接到该图像与关键profile_image_url

This answer应该提供更多的细节来帮助你弄明白。

+0

感谢它现在的工作;) – Boom 2014-10-02 07:47:28

相关问题