PHP Fetching Google web history - php

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.
Script to download Google web history
Retrieve old searches from Google web history (has some code in C#, don`t know how to convert to PHP)
Thanks

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/

Related

Custom display of posts of Facebook, Twitter, Linkedi and Google+ on your website

Is it possible to shows posts, feeds etc in a customized manner on your website? For example if I don't want to use the plugins they provide to embed on your website which show posts in a rectangular box I want to show posts from these social media sites in different manner. For reference please visit this website and scroll down to section below Latest News and Testimonials you will find Facebook, Twitter, LinkedIn and Google+ with Lorem Ipsum text. It seems like this website has also not implemented this feature (don't know if its possible with all social sites) but I am asking if you need to implement something like this is this possible? I have to implement it on a PHP website, if that helps. Thanks for your help in advance.
Although you're asking for something different than embedding, I still believe what you're looking for is "Embedding posts". Most social sites do not want you to rebuild their stream experience and put it somewhere else -- additionally, most content policies on these sites prohibits you from caching or storing posts because it can easily become a privacy issue. Finally, if you're pulling a lot of posts, frequently, from these services, you will encounter API call limits.
The following resources should get you started with properly embedding posts so you don't have to worry about how you're caching:
Google+
Facebook
Twitter
If you (really, really) wanted to build out your own solution you should do it client-side in JavaScript, not in PHP. For this, you would need to use the following APIs:
Google+ uses the Activity API
Facebook has the Graph/Feed API
Twitter has the Search/Get Tweets API pass from%3A[username] to get specific user Tweets
If you were to try doing this in PHP, it would be easier using client libraries and starting from sample code.
Google+ PHP example
Facebook PHP client library
Twitter PHP client libraries
Make sure that you're following the content policies of the various sites you're aggregating. In other words, if you're doing something like caching the results in a MySQL database pulled using your PHP script, invalidate the cache every 3600 seconds and every time a post is no longer retrieved from your API calls.

Twitter API or Library to remember the session

I've been going through the Twitter API, but they are not as friendly as Facebook. My requirement is remember the authentication in the server / db and post user messages to the timeline without invoking twitter UI. Ofcourse I know we need to allow first time authentication via Twitter UI.
I'm not sure where to start and 2 days of Google search didn't end at any place where I can get started. Is there any document, resources, library (PHP or JavaScript) available to execute such scenario?
Thanks in advance.
This is a wonderful tutorial on how to auto post via PHP to Twitter. Check it out

Twitter API: How to change from RSS Feed to new API 1.1?

Twitter has suddenly changed their API and I'm very sad about that. My PHP-Script got RSS requests and that worked fine for me. It was fast, convenient and easy to understand and implement.
But in June 2013, Twitter disabled RSS requests and suggests to use their new API with something strange like JSON or OAUTH. What's this? - At first, it's unconvenient, complicated and difficult to understand.
1) What ist the difference between
- REST API version 1.1 and
- The Streaming APIs ?
Twitter doesn't explain the difference.
2) How can I get query requests with PHP? Twitter missed to explain that and I haven't found someone who knows how to get query results from Twitter with PHP.
I've answered this on the WebApps SE site: https://webapps.stackexchange.com/a/45963/42726
You now need to create youself a new Twitter App and then install the Twitter-RSS-Parser from github onto your site. Then you should be able to access your RSS feed at http://mydomain.com/Twitter-RSS-Parser/?home
I know it's a little late but I ran into the same problem and actually created an online service that should take care of it for you. Basically, you can take any JSON v1.1 Twitter API call and have it returned in RSS (XML) format. You should be able to change the RSS URLs from Twitter to the new URL provided to you with limited modifications to your app.
Take a look and see if it helps you...
http://tweet-2-rss.appspot.com

YQL + PHP : how to make a facebook login

I was reading some stuff about the YQL api that Yahoo! has provided, I am not sure, but it appears to be a collection of lots of third party api into one common language, right?
what I don't get is how to make the facebook login through it so I can get the user profile data...
My project is to add a facebook(and other social networks) form login, because the website won't have his own login, people will have to use a social network to link in. Then I thought the YQL would help me out with this task so I wouldn't have to develop lots of functions to each one of the networks.
Reading this http://developer.yahoo.com/yql/guide/yql-code-examples.html#sdk_yql, I understood how to make a Yahoo login so I can access some private data, but couldn't find how I could do it with facebook and others
So my question... Can YQL help me with this? Can you give me a simple example of a facebook session using it within PHP? Are there alternatives to aid me in this task?
thanks,
Jonathan
Yes , using YQL you will be able to do this task .. you can look at this demo http://demo.tutorialzine.com/2010/05/showing-facebook-twitter-rss-stats-jquery-yql/demo.html. Also if you are going to only use Facebook authentication , then there is no need for YQL you can do it using http://developers.facebook.com/docs/authentication/
I highly doubt that YQL has an API that gives a free hand with facebook login. You have to consider how a login works. You send POST data to a web server containing client-side password hashes and encryptions, as well as other kinds of identification. YQL has no way to "standardize" logins - it would have to make a new API for every popular web site.

How to set up a database and API web page to accept POST updates from iPhone?

I am developing an iPhone app, which now can update Twitter account with GPS coordinates in real-time, by the Twitter API link: http://username:password#twitter.com/statuses/update.xml , and I am looking at how to make my own database to accept updates from iPhone, via a similar API page.
It seems a .php page can serve as the API, and MySQL can serve as the database.
What are the good ways of doing it? Any template code and tutorial please?
Try one of these:
http://www.webresourcesdepot.com/how-to-create-an-api-10-tutorials/
Thanks for the answer. I found the php page just need code like
$userid=$_POST["userid"];
$companyid=$_POST["companyid"];
$phoneid=$_POST["phoneid"];
to receive POST from the iphone app.

Categories