Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #15403

Re: login Gmail through CURL

From "M. Strobel" <strobel@example.com>
Newsgroups comp.lang.php
Subject Re: login Gmail through CURL
Date 2015-06-03 21:23 +0200
Organization A noiseless patient Spider
Message-ID <mknk4d$g64$1@dont-email.me> (permalink)
References <1120713229.337375.185990@g43g2000cwa.googlegroups.com> <KNWdnWOjv_kItPPInZ2dnUU7-VOdnZ2d@giganews.com>

Show all headers | View raw


On 03.06.2015 00:09, prathyusha wrote:
> Iam using below code to login in to gmail but iam unable to login please let me know the changes i have to do to get login
> $user=$this->data['User']['email'];
>          $password=$this->data['User']['password'];
>          //========================================== step 1: login ===========================================================
>              $login_url = "https://www.google.com/accounts/ClientLogin";
>              $fields = array(
>                  'Email' => $user,
>                  'Passwd' => $password,
>                  'service' => 'cp', // <== contact list service code
>                  'source' => 'test-google-contact-grabber',
>                  'accountType' => 'GOOGLE',
>              );
>
>              $curl = curl_init();
>              curl_setopt($curl, CURLOPT_URL,$login_url);
>              curl_setopt($curl, CURLOPT_POST, 1);
>              curl_setopt($curl, CURLOPT_POSTFIELDS,$fields);
>              curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
>              curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
>              $result = curl_exec($curl);
>
>             echo "<pre>";
>             print_r($result);
>
>
 From your code I guess you want to read your contacts.

It is not a good idea to try web scraping with a simple download tool, in times of 
pervasive javascript and ajax usage. I bet you get an empty page frame.

Use the contact API instead.

And do a better analysis of your requirements and possible solutions next time.

/Str.

Back to comp.lang.php | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: login Gmail through CURL prathyusha <prathyusha.k@flatmindtech.com> - 2015-06-02 17:09 -0500
  Re: login Gmail through CURL Jerry Stuckle <jstucklex@attglobal.net> - 2015-06-02 19:08 -0400
  Re: login Gmail through CURL "M. Strobel" <strobel@example.com> - 2015-06-03 21:23 +0200

csiph-web