2014-10-02 90 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