Nerrsoft的Tweets页面

好吧, 这是一个简易的Tweets页面, 应推友@lene_wf要求写了几个步骤, 实现的关键是你的WP主机要在国外, 或者或者….使用代理或是自建API之类的, 但这个不是讨论的重点.

页面的CSS copy了”中文推特圈”或是”rabr”, 额~~~~为什么是或? 说真的, 我的确不记得了~~~~~

1. 创建 一个WordPress Page, 取名为”Tweets”(当然,你可以根据需求命名)
2.下载Arc90的Full Twitter API client library written in PHP , 放在WP当前theme目录下面
3.修改WP当前theme的page.php, 在输出titel行下面(the_title();这行),加入如下代码:

PHP
<?php 
if(the_title('','',false)=='Tweets'){
	include('twitter.php');
}
?>

记得那个’Tweets’就是step 1中的页面名称.

4.下载下面的twitter.txt, 修改后缀名为.php, 然后编辑该脚本. 找到$tUsername和$tPassword, 修改为你的Twitter用户名和密码, 保存

5.Test, 如果没有意外应该可以在你WP的相应页面看到你的推了

 

效果参见: http://nerrsoft.com/tweets

我突然想, 要不要把它做成Plugin? 但好像意义不大. 那就算了吧. HOH


下载twitter.txt

Comments (11)

  1. 霁飞  / Reply

    页面字体可以改嘛?是跟主题有关还是twitter API的关系?

1 2

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Pingbacks (0)

› No pingbacks yet.