How PHP Gets the latest news from Twitter
This example explains how PHP gets the latest news from Twitter. Share to everyone for your reference. The implementation method is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function Get_status ($twitter _id, $hyperlinks = True) { $c = Curl_init (); curl_setopt ($c, Curlopt_url, "http://twitter.com/statuses/user_timeline/$twitter _id.xml?count=1"); curl_setopt ($c, Curlopt_returntransfer, 1); $SRC = curl_exec ($c); Curl_close ($c); Preg_match ('/ (. *) <\/text>/', $SRC, $m); $status = Htmlentities ($m [1]); if ($hyperlinks) $status = ereg_replace ("[[: alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "\\0", $status); return ($status); } ?> |
http://www.bkjia.com/PHPjc/983319.html www.bkjia.com true http://www.bkjia.com/PHPjc/983319.html techarticle PHP How to get the latest news from Twitter The example in this article describes how PHP gets the latest news from Twitter. Share to everyone for your reference. The implementation method is as follows: 1 2 3 4 5 6 7 8 9 ...