Created
September 14, 2010 12:49
-
-
Save hmert/578978 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* rating password by Google | |
* | |
* @author hatem <[email protected]> | |
* @param password the password to rate by google. | |
* @return rate | |
* @return string | |
*/ | |
function ratePass($password) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/accounts/RatePassword?Passwd=' . urlencode($password)); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); | |
$result =curl_exec ($ch); | |
curl_close ($ch); | |
return $result; | |
} | |
/* ### basic usage #### | |
$rate = ratePass('huseyinmert'); | |
print_r($rate); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment