Skip to content

Instantly share code, notes, and snippets.

@hmert
Created September 14, 2010 12:49
Show Gist options
  • Save hmert/578978 to your computer and use it in GitHub Desktop.
Save hmert/578978 to your computer and use it in GitHub Desktop.
/**
* rating password by Google
*
* @author hatem <huseyin@hmert.com>
* @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