O'Reilly logo

Developing with Google+ by Jennifer Murphy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Public Data APIs

The RESTful data APIs are the core of the Google+ platform. These APIs provide read access to public fields on profiles, activities, and comments. Access to private data, specifically a user’s identity on Google+, is controlled by OAuth 2.0, and API quotas are controlled by API keys.

The easiest way to gain an understanding of the public data APIs is to see them in action.

Integrating Google+ Comments

Baking Disasters is pretty cool, but do you know what would make it cooler? Comments would. Discussion can bring a blog to life, but sadly, they come at a cost. Not only do you need to worry about spam comments, but you also have to expose potentially sensitive software to the outside world.

Fortunately, the Google+ public data APIs expose the comments on your public activities. Since you’re already sharing your blog posts to Google+, you can use JavaScript to render the comments from the activity right in the blog entry. Not only does this prequalify users to reduce spam, but it also allows you to keep Baking Disasters static HTML.

Experiment with the APIs

Before you start coding, spend some time to become comfortable with how the APIs behave. The API Explorer from the introduction chapter is perfect for this. You can find it here: https://developers.google.com/apis-explorer/#s/plus/v1/.

Use the API Explorer to trace the same steps that the comments plugin will follow.

  1. Scan through the available methods in the API Explorer. The comments.list method, pictured in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required