1. $ch = curl_init();
  2.    
  3.     curl_setopt($ch, CURLOPT_URL, "https://www.google.com/accounts/ClientLogin");
  4.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  5.    
  6.     $data = array('accountType' => 'GOOGLE',
  7.     'Email' => 'emailgoeshere@gmail.com',
  8.     'Passwd' => 'passwordhere',
  9.     'source'=>'nameyourapp',
  10.     'service'=>'reader');
  11.    
  12.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  13.     curl_setopt($ch, CURLOPT_POST, true);
  14.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  15.     curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  16.    
  17.     $loginResult = curl_exec($ch);
  18.    
  19.     // this is the meat:  grabbing the "Auth" value from the token we get back
  20.     $authRaw = strstr($loginResult, "Auth");
  21.     $authToken = substr($authRaw, 5);
  22.    
  23.     // this builds the action we'd like the API to perform
  24.     $ch = curl_init("http://www.google.com/reader/atom/user/-/state/com.google/reading-list");
  25.    
  26.     $header[] = 'Authorization: GoogleLogin auth='.$authToken;
  27.    
  28.     curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  29.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  30.     curl_setopt($ch, CURLOPT_HEADER, false);
  31.    
  32.     $xml = curl_exec($ch);
  33.     curl_close($ch);