2010-11-28 8 views
0

아무에게도이 점을 지적 해 주시겠습니까? ?AuthSub을 사용하여 Google 연락처 데이터 가져 오기

<?php 
if(!empty($_GET)) 
{ 
    if(isset($_GET['token'])) 
    { 
     $token = $_GET['token']; 

     $ch = curl_init('https://www.google.com/m8/feeds/'); 

     if($ch) 
     { 
      curl_setopt 
      (
       $ch, 
       CURLOPT_HTTPHEADER, 
       array 
       (
       /* "Content-Type: application/x-www-form-urlencoded",*/ 
        "Authorization: AuthSub token=\"{$token}\"" 
       ) 
      ); 
      curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); 
      //curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true); 
      curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false); 
      curl_setopt($ch,CURLOPT_HTTPGET,true); 
      curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); 
      curl_setopt($ch,CURLOPT_HEADER,true); 
      //curl_setopt($ch,CURLOPT_POST,true); 

      $res = curl_exec($ch); 

      echo $res.'<br />'; 
     } 
    } 
} 
>

그리고 이것은 Google에 사용자를 리디렉션을 사용하여 링크 메신저입니다 -

HTTP/1.1 400 Bad Request 

콘텐츠 - -

https://www.google.com/accounts/AuthSubRequest?scope=https://www.google.com/m8/feeds/&session=0&secure=0&next=http://www.etfaq.com/invite_friends.php%3Ftype%3Dgmail

그것은 저에게이주는 유지 유형 : text/html; charset = UTF-8 날짜 : 2010 년 11 월 28 일 09:59:53 GMT 만료 날짜 : 일요일, 28 11 월 2010 09:59:53 GMT 캐시 제어 : 개인, 최대 연령 = 0 X- 컨텐츠 -Type-Options : nosniff X- 프레임 옵션 : SAMEORIGIN X-XSS- 보호 : 1; 모드 = 블록 서버 : GSE 전송 - 인코딩 :

잘못된 요청 URI

어떤 생각 누구

청크? 내가 하나 개 이상의 장소에서 잘못된 메신저 알고 있지만, 내 머리는 거의 4 시간이 함께 노력하고 메신저로 작동하지 않는 : D

감사합니다, ANJAN

답변

0

미안 해요 내 실수 :

I 내가 사용해야한다는 것을 알았습니다.

curl_init ('https://www.google.com/m8/feeds/default/full');

대신

curl_init의 ('https://www.google.com/m8/feeds/');

감사합니다. Anjan

관련 문제