下面是如何使用JSON做到了 -
<?php
$perPage = 50; // how many you want to display
$dribbble_username = 'yourusername'; // dribbble username
$dribbble_access_token = 'youraccesstoken'; // access token
$dribbble_data = file_get_contents("https://api.dribbble.com/v1/users/$dribbble_username/shots?access_token=$dribbble_access_token&per_page=$perPage");
$dribbble = json_decode($dribbble_data, true);
foreach($dribbble as $shot) : ?>
<a href="<?php echo $shot['html_url'] ?>" target="_blank">
<img src="<?php echo $shot['images']['hidpi'] ?>" alt="<?php echo $shot['title'] ?>">
</a>
<?php endforeach ?>
記得註冊您的應用程序,以獲得訪問令牌。完成之後,您可以簡單地將https://api.dribbble.com/v1/users/yourusername/shots?access_token=youraccesscode放入瀏覽器中查看可以播放的內容數組。祝你好運;)
我很感謝你,但實際上我需要'寫'範圍。客戶端訪問令牌只允許訪問具有「公共」範圍的端點。更新的問題澄清這一點,對不起。 – oscarmarcelo 2015-03-20 19:22:37