Posts

Showing posts from August, 2012

Retrieving Comments From Google+ Events

Had a question earlier about whether it was possible to retrieve comments from an event on Google+, and the answer is yes! As long as it's public, you can grab it via the REST public data APIs.

Taking as an example tonight's London Photowalk event, we need to first get the id of the activity. This can be done by grabbing the public posts by the Photowalk account:


GET https://www.googleapis.com/plus/v1/people/111455345092279041936/activities/public?alt=json&key={YOUR_API_KEY} X-JavaScript-User-Agent: Google APIs Explorer

The ID  "111455345092279041936" there is the ID of the Photowalk account. From that list we just need to find our event, and get the ID. You can generally see the Events posts by the provider field in the JSON of the object attached to the post.


"provider": "Events" },
We can then request the list of comments for that id using the plus.comments.list functionality.

GET https://www.googleapis.com/plus/v1/activities/z13xifyx5y…

Google+ History Is Your Oyster

Image
The History functionality in Google+ is an interesting answer to a pretty common question of "where's the write API?" It allows creating moments in a user's (private) history, which can then be reshared. It's currently in developer preview, for the express purpose of getting feedback on the API. 
One of the bits of feedback that has been acted on recently is support for setting the date of a moment, instead of just using the date on which the moment was submitted. This is done by setting a startDate field in the main JSON structure submitted to the API: 
{
"type":"http://schemas.google.com/AddActivity", "target":{ "url":"https://example.com/thing" }, "startDate": "2012-08-09T13:15:12+02:00" }
This means that things that happened in the past can now be added to a users history, which is quite convenient some application. As I happened to be renewing my Oyster (London's RFID transport card) season t…

Notes: Sharing to Google+ on IOS

Image
It has been a long time since I touched any IOS code, so I was quite looking forward to a chance to do some when the IOS team within Google+ released the SDK into preview at Google I/O last month. Luckily, the documentation on the SDK page on developers.google.com is excellent, and covers the basics of the setup, but in part because I've forgotten almost everything about XCode and IOS, I thought it best to just write down what I did and what I encountered, primarily as an Aide-mémoire for the future. Anyone building a new app should follow the documentation - but perhaps some developers will hit an issue I did and get something out of this post!

First things first, I had to set up a new OAuth2 client id at the API developer console with permissions for the Google+ API (I also added the Google+ History API, though this app does not use it so far). Next I created an OAuth2 client id for an installed application. It's important to make sure that the bundle ID specified here match…