在 Google Spreadsheet 里面显示 twitter followers count

网上无意中看到一篇文章,介绍如何在 Google Spreadsheet 里面显示 twitter followers count,利用了 importXML 函数。不过很可惜,importXML 函数只支持一个 sheet 内 50 次查询,所以作者又介绍了 Yahoo! Pipes 法。这个有些复杂。

能显示 twitter followers count 后可以做两件事情,第一件事就是以后统计 id 的时候可以很方便的计算 followers,并根据此排序。不过在 id 数超过 50 的时候需要分批手动计算,50 以内可以自动更新了。第二件事就是计算自己的 twitter followers count,并画图。

我们先来看看调用的 XML 吧:http://twittercounter.com/api/?output=xml&username=terryxxy

结果如下:

<twittercounter>
<user_id>570206</user_id>
<user_name>terryxxy</user_name>
<url>http://terryxxy.com</url>

<avatar>

http://a1.twimg.com/profile_images/354784696/twitterProfilePhoto_normal.jpg

</avatar>
<followers_current>1635</followers_current>
<date_updated>2009-09-15</date_updated>
<follow_days>355</follow_days>
<started_followers>4</started_followers>
<growth_since>1631</growth_since>
<average_growth>5</average_growth>
<tomorrow>1640</tomorrow>
<next_month>1785</next_month>
<followers_yesterday>1626</followers_yesterday>
<rank>41469</rank>
<followers_2w_ago>4</followers_2w_ago>
<growth_since_2w>1631</growth_since_2w>
<average_growth_2w>117</average_growth_2w>
<tomorrow_2w>1752</tomorrow_2w>
<next_month_2w>5145</next_month_2w>

<followersperdate>
<date2009-09-03>1083</date2009-09-03>
<date2009-09-04>1092</date2009-09-04>
<date2009-09-05>1094</date2009-09-05>
<date2009-09-06>1111</date2009-09-06>
<date2009-09-07>1116</date2009-09-07>
<date2009-09-08>1126</date2009-09-08>
<date2009-09-09>1131</date2009-09-09>
<date2009-09-10>1358</date2009-09-10>
<date2009-09-11>1640</date2009-09-11>
<date2009-09-12>1641</date2009-09-12>
<date2009-09-13>1629</date2009-09-13>
<date2009-09-14>1626</date2009-09-14>
<date2009-09-15>1635</date2009-09-15>
</followersperdate>
</twittercounter>

我们利用这个来做表格:

  • A1-D1 填写 id,today,rank,tomorrow
  • A2 填写 terryxxy
  • B2 填写 =ImportXML(“http://twittercounter.com/api/?output=xml&username=”&A2,”//followers_current” )
  • C2 填写 =ImportXML(“http://twittercounter.com/api/?output=xml&username=”&A2,”//rank” )
  • D2 填写 =ImportXML(“http://twittercounter.com/api/?output=xml&username=”&A2,”//tomorrow” )
  • A3,A4 填写 date,followers
  • B4 填写 =ImportXML(“http://twittercounter.com/api/?output=xml&username=”&A2,”//followersperdate” )
  • N3 填写 =TODAY()
  • M3 填写 =N3-1,然后向左拖序列
  • O3 填写 tomorrow
  • O4 填写 =ImportXML(“http://twittercounter.com/api/?output=xml&username=”&A2,”//tomorrow” )
  • 然后画一个 chart

结果如下:

然后可以把 chart 输出:

最后要说一下的是,不要纠结自己的 followers 数,这个只能娱乐,followings, friends 和有效的 followers 才更重要。

Share

6 条评论了已经

Trackbacks/Pingbacks

发表评论

名字(必须)
邮箱(必须),(不会被公布)
网址(推荐)

字体为 粗体 是必填项目,邮箱地址 永远不会 被公布。

允许部分 HTML 代码:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
URLs(网站链接)必须完整有效 (比如: http://terryxxy.com),所有标签都必须完整的关闭。

超出部分系统将会自动分段及换行。

请保证评论内容是与日志或 Blog 内容相关的,灌水、攻击性或不恰当的评论 可能 会被编辑或删除。