Twitter关注者图片列表
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Twitter关注者图片列表相关的知识,希望对你有一定的参考价值。
A simple script to show a followers list in Wordpress. (It can be used in other places also, you have to change the WP specific variables). The script needs to create a cache file to not overload Twitter API.
<?php //replace $options['twitter'] with the twitter Username you want to use. ?> <?php $xmlfollowersUrl = 'http://api.twitter.com/1/statuses/followers/'.$options['twitter'].'.xml'; $twitter_followers = $data['twitter_result']; } } if (!$twitter_followers) { // cache doesn't exist or is older than 10 mins } $dom = new DOMDocument; $count = 0; echo '<ul class="seguidores">'; foreach($s->user as $follower): if(++$count > 50){ break; } echo '<li><a target="_blank" href="http://www.twitter.com/'.$follower->screen_name.'"><img width="32" height="32" src="'.$follower->profile_image_url.'" alt="'.$follower->name.'" title="'.$follower->name.': '.$follower->status->text.'"/></a></li>'; endforeach; echo '</ul>'; ?>
以上是关于Twitter关注者图片列表的主要内容,如果未能解决你的问题,请参考以下文章
Twitter API - 为拥有数百万关注者的帐户获取关注者列表的有效方法