Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7927623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:24:05+00:00 2026-06-03T19:24:05+00:00

I used to access my Google Bookmarks, server side with this PHP code: $curlObj

  • 0

I used to access my Google Bookmarks, server side with this PHP code:

$curlObj = curl_init();
curl_setopt($curlObj, CURLOPT_URL, "https://www.google.com/bookmarks/?output=rss");
curl_setopt($curlObj, CURLOPT_USERPWD, "whatever@googlemail.com:mypassword");
curl_setopt ($curlObj, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($curlObj);
echo $response;
curl_close($curlObj);

Formerly, with the code above, I would have seen an XML feed.

Now it shows “302 Your document has moved. Click Here”.
The link takes me to a login page.

Any ideas?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T19:24:09+00:00Added an answer on June 3, 2026 at 7:24 pm

    such authorization is no longer working. you need auth via https://accounts.google.com/ServiceLogin and after get https://www.google.com/bookmarks/?output=rss

    example:

    <?
    $USERNAME = 'aaa';
    $PASSWORD = 'bbb';
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
    curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
    curl_setopt($ch, CURLOPT_TIMEOUT, 120);
    
    curl_setopt($ch, CURLOPT_URL,
      'https://accounts.google.com/ServiceLogin?hl=en&service=bookmarks&continue=http://www.google.com/bookmarks');
    $data = curl_exec($ch);
    
    $formFields = getFormFields($data); // my code to get form fields, ask if you want it
    
    $formFields['Email']  = $USERNAME;
    $formFields['Passwd'] = $PASSWORD;
    unset($formFields['PersistentCookie']);
    
    $post_string = '';
    foreach($formFields as $key => $value) {
        $post_string .= $key . '=' . urlencode($value) . '&';
    }
    
    $post_string = substr($post_string, 0, -1);
    
    curl_setopt($ch, CURLOPT_URL, 'https://accounts.google.com/ServiceLoginAuth');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
    
    $result = curl_exec($ch);
    $info = curl_getinfo($ch);
    // echo var_dump($info);
    if ($info['url']=="https://accounts.google.com/ServiceLoginAuth")
        {
          die("Login failed");
        var_dump($result);
     } else {
        curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/bookmarks/?output=rss');
        curl_setopt($ch, CURLOPT_POST, 0);
        curl_setopt($ch, CURLOPT_POSTFIELDS, null);
    
        $result = curl_exec($ch);
    
        var_dump($result);
    }
    
    function getFormFields($data)
    {
        if (preg_match('/(<form id=.?gaia_loginform.*?<\/form>)/is', $data, $matches)) {
            $inputs = getInputs($matches[1]);
    
            return $inputs;
        } else {
            die('didnt find login form');
        }
    }
    
    function getInputs($form)
    {
        $inputs = array();
    
        $elements = preg_match_all('/(<input[^>]+>)/is', $form, $matches);
    
        if ($elements > 0) {
            for($i = 0; $i < $elements; $i++) {
                $el = preg_replace('/\s{2,}/', ' ', $matches[1][$i]);
    
                if (preg_match('/name=(?:["\'])?([^"\'\s]*)/i', $el, $name)) {
                    $name  = $name[1];
                    $value = '';
    
                    if (preg_match('/value=(?:["\'])?([^"\'\s]*)/i', $el, $value)) {
                        $value = $value[1];
                    }
    
                    $inputs[$name] = $value;
                }
            }
        }
    
        return $inputs;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used this code to access the Specific XML under the SharePoint Mapped Folder;
I am doing this PHP page that have access to a Google account and
google's documentation says the google maps javascript api can be used to access the
my setup is ubuntu - gitolite - msysgit. After following this tutorial : https://sites.google.com/site/senawario/home/gitolite-tutorial
I have often used, and seen recommended, dom-access structures like this for adding content
Google Contacts API 3.0 is described here: https://developers.google.com/google-apps/contacts/v3/reference But this document is not complete.
I am using Spring. A properties placeholder is used to access all properties in
CIFS is common internet file system, which is a protocol used to access windows
I use an Access database used just as back end. I use some Memo
In android R.java is used to provide access to resources defined in XML files.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.