2010-03-31 47 views
0

嘿,我一直在與Twitter的API玩弄,我需要一兩件事,沒有教程涵蓋..PHP - 檢查的Twitter用戶名和密碼

這裏對我使用拿起碼數據:

$curlhandle = curl_init(); 
curl_setopt($curlhandle, CURLOPT_URL, "http://twitter.com/statuses/user_timeline.xml"); 
curl_setopt($curlhandle, CURLOPT_USERPWD, $username.':'.$password); 
curl_setopt($curlhandle, CURLOPT_RETURNTRANSFER, 1); 
$response = curl_exec($curlhandle); 
curl_close($curlhandle); 
$xmlobj = new SimpleXMLElement($response); 

現在我可以使用,不知怎的來檢查,如果$ username和$ password是有效的?

要更多解釋什麼,我需要它..我有一個表格,用戶可以輸入自己的用戶名和我需要能夠告訴他,如果插入的數據是在/有效的登錄。

回答

2

我也不會想到,這將是可能的。

Twitter的條款和條件,使用戶負責他們的憑據。給他們第三方(即你)是非常不負責任的。

這就是爲什麼Twitter的OAuth的實現。