Exemplo n.º 1
0
/**
*  get the sign-in user profile. 
*  @param string $fcauth The fcauth string get from cookie
*  @return a user(as an array) if success. false if failed
*/
function getGFCProfile($fcauth)
{
    $apiurl = "http://www.google.com/friendconnect/api/people/@me/@self";
    $apiurl .= '?fields=aboutMe,profileUrl,urls&';
    $apiurl .= 'fcauth=' . $fcauth;
    $content = httpgets($apiurl, '');
    if ($content == '') {
        return false;
    }
    $content = $content['body'];
    $obj = json_decode($content, true);
    if ($obj) {
        return $obj["entry"];
    } else {
        return false;
    }
}
 /**
  * Get the md5 cheksum of an image, given its url
  * @param $url : the url of an image
  * @return the md5sum of the image, or empty string if failed. 
  * */
 public function Checksum($url)
 {
     $response = httpgets($url);
     if (!$response) {
         return "";
     } else {
         $image = $response['body'];
         $cheksum = md5($image);
         return $checksum;
     }
 }