2010-03-21 39 views
0

即時通訊使用捲曲去取我的Twitter的最愛:Twitter的喜愛和超過20

<?php 
$username = "bob"; 
$password = "password"; 
$twitterHost = "http://twitter.com/favorites.xml"; 
$curl; 
$curl = curl_init(); 
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2); 
curl_setopt($curl, CURLOPT_HEADER, false); 
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); 
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($curl, CURLOPT_USERPWD, "$username:$password"); 
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); 
curl_setopt($curl, CURLOPT_URL, $twitterHost); 
$result = curl_exec($curl); 
curl_close($curl); 
header('Content-Type: application/xml; charset=ISO-8859-1'); 
print $result; 
?> 

然而,這僅獲取最後20個收藏夾,不是所有的人。

如果我修改該行:

$twitterHost = "http://twitter.com/favorites.xml"; 

並將其更改爲:

$twitterHost = "http://twitter.com/favorites.xml?page=2"; 

我能得到下一組20周的最愛。

似乎無論如何,使用Twitter API來找出有多少頁的收藏夾。

像這樣任何人都可以建議獲得所有最愛的最佳方式?

或者如果這是不可能的,獲取所有推文的日期範圍?

回答