Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #15385 > unrolled thread
| Started by | prathyusha <prathyusha.k@flatmindtech.com> |
|---|---|
| First post | 2015-06-02 17:09 -0500 |
| Last post | 2015-06-03 21:23 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.php
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
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
| From | prathyusha <prathyusha.k@flatmindtech.com> |
|---|---|
| Date | 2015-06-02 17:09 -0500 |
| Subject | Re: login Gmail through CURL |
| Message-ID | <KNWdnWOjv_kItPPInZ2dnUU7-VOdnZ2d@giganews.com> |
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);
[toc] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2015-06-02 19:08 -0400 |
| Message-ID | <mkld06$1ve$1@dont-email.me> |
| In reply to | #15385 |
On 6/2/2015 6:09 PM, 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 <snip code> You don't give any information on what you expect, or on what you get for a result. Additionally, few, if any, here have probably tried to log into gmail this way. I'd recommend you ask in the Gmail support groups. They know their code and APIs better than anyone else. Be prepared to tell them what your results are and what you think you should be getting. -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | "M. Strobel" <strobel@example.com> |
|---|---|
| Date | 2015-06-03 21:23 +0200 |
| Message-ID | <mknk4d$g64$1@dont-email.me> |
| In reply to | #15385 |
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.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web