2

I am building a site in PHP which will allow users to view their last 5-10 google web history keywords on their profile page. I know that google history is available as a RSS feed at following URL :

https://www.google.com/history/?output=rss

How can I write a code in php which will pass username and password to google and allows to fetch keywords from it programmatically.

Any help is much appreciated as I am stuck in this. I have visited following questions but they did`t helped much.

  1. Script to download Google web history

  2. Retrieve old searches from Google web history (has some code in C#, don`t know how to convert to PHP)

Thanks

Community
  • 1
  • 1
Sam
  • 121
  • 4

1 Answers1

0

It looks like that RSS feed uses HTTP basic auth.

You can use Curl to do the authentication and fetching then parse the RSS feed to retrieve the history.

For basic auth with curl see: How do I make a request using HTTP basic authentication with PHP curl?

And theres plenty of RSS parsers in php... here's just one: http://magpierss.sourceforge.net/

Community
  • 1
  • 1
Kane Wallmann
  • 2,292
  • 15
  • 10
  • I tried using php curl for accessing history using basic auth. I also tried the methods described at : http://kovshenin.com/2009/10/google-docs-api-client-login-with-php-and-curl-1494/ but without any success. :( – Sam Feb 22 '12 at 07:18