Brief introduction
Google + is a new product of the social networking industry, the latest attempt to build a social network that allows users to easily share news and files with their friends and interact with them. It seemed to succeed in capturing the imagination of the public. It is reported that as of December 2011, 625,000 new users registered with Google + every day, the total number of users has reached 62 million.
Common abbreviations
API: Application Programming Interface
HTTP: Hypertext Transfer Protocol
Json:javascript Object Symbol
PHP: Hypertext Preprocessor
Web developers have reason to be excited about Google +. Like many other Google services, Google + is accompanied by a developer API that allows you to access user-generated content through your own custom application. Because the API provides its output in JSON form, it can be easily integrated with most programming toolkits.
This article will introduce the Google + Data API, learn how to use it to extract content from Google +, and how to integrate it into a PHP application. (This is very interesting, so warn you beforehand that you may be addicted to it.) )
Basic knowledge of the API
Before you start developing your application with Google +, you need to understand how it works. The API works through HTTP and expects to obtain an HTTP request to the specified endpoint. When this request is received, the API server responds to the query with a JSON feed that contains the requested data. You can then parse and extract content from a server-side programming language (such as PHP or Perl) or a client toolkit (such as JQuery or mooTools) to integrate it into a Web page.
First you need to do a few things:
Set up the Google + account.
Log in to Google account and register a Google + accounts with the "+you" link in the main menu.
Go to the Google Account Settings page and retrieve your personalized Google profile URL, which contains your Google ID, as shown in Figure 1.
Record this ID carefully; some of the examples in this article need to use it.
Figure 1. Google profile URL with Google ID