[PHP]用15行PHP來Twitter!

就降子15行
在任何可以用PHP的地方開始Twitter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function tweet($message, $username, $password)
{
    $context = stream_context_create(array( 
        'http' => array( 
        'method' => 'POST', 
        'header' => sprintf("Authorization: Basic %s\r\n", base64_encode($username.':'.$password)). 
            "Content-type: application/x-www-form-urlencoded\r\n", 
        'content' => http_build_query(array('status' => $message)), 
        'timeout' => 5, 
        ), 
    )); 
    $ret = file_get_contents('http://twitter.com/statuses/update.xml', false, $context); 
 
    return false !== $ret;
}

不過前提是php.ini 中的 file_get_contents得先打開才行

[WP外掛]捨棄WP Super Cache換上Hyper Cache

WP Super Cache算是JUSTBLOG很元老級的外掛了
我也一直很努力的跟它和平相處
不過我卻依然發現很多時候網站會被他搞得很奇怪
都是在強制停用它後就得到解決的@@
剛好看到高登工作室的這一篇這一篇
也到ismyblogworking測了一下JUSTBLOG的速度
果不其然就成了我拋棄WP Super Cache的導火線拉
拼拼乓乓照著高老爺的說明把Hyper Cache換上來後
感覺速度真的有快了一點
http://ismyblogworking.com/justfly.idv.tw
不過看起來還不是很盡善盡美
再找時間來研究要怎麼調吧~~