Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

login Gmail through CURL

19 views
Skip to first unread message

Zeeshan

unread,
Jul 7, 2005, 1:13:49 AM7/7/05
to
Hi,

I am able to login Gmail through CURL, But I could goto Contacts Page,

Please let me know If you have any solution.

Contact URL http://mail.google.com/mail/h/qwsanjhbkyco/?pnl=a&v=cl
where "qwsanjhbkyco" is randomly generated.

Zeeshan

unread,
Jul 7, 2005, 1:13:56 AM7/7/05
to

Alvaro G Vicario

unread,
Jul 7, 2005, 6:14:04 AM7/7/05
to

Whatever that ID is, it doesn't seem to matter which one it is. Check it
yourself if you don't believe it.

In any case, in order to get a link you'd just need to parse the HTML using
regular expressions: preg_match(), etc.


--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--

prathyusha

unread,
Jun 2, 2015, 6:09:29 PM6/2/15
to
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);


Jerry Stuckle

unread,
Jun 2, 2015, 7:09:09 PM6/2/15
to
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
jstu...@attglobal.net
==================

M. Strobel

unread,
Jun 3, 2015, 3:23:12 PM6/3/15
to
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.
0 new messages