There are currently no official comment plugins, but you can use the REST API to access comments that were made in public messages through comments.list .
This means that if you open a page on Google+ through public activity, you can use the API to display all the comments made in this activity on Google+, and then display them on your page. You can then associate visitors with activity, thereby allowing them to participate in the conversation.
I have seen several implementations of this technique. Here is an implementation of JavaScript designed to go to a static HTML blog. I will not play the entire recording here, as it is quite attractive, but the essence of what you need to do:
- Get API key to access Google+ API
- Paste the public activity ID into your document. In a related example, it places it in a div class.
- Use the JSONP REST API to get comments for this action. If one page of comments is enough, this is one liner.
https://www.googleapis.com/plus/v1/activities/_somePublicActivityId_/comments?key=_yourApiKey_&callback=myawesomecallback
From your callback function, print the comments somewhere on the page.
function myawesomecallback(resposneJson) { var activity = resposneJson.items[0].inReplyTo[0]; var comments = resposneJson.items; //find element to insert into var insertionElements = document.getElementsByClassName('g-comments-for ' + activity.id); var insertionElement = insertionElements[0]; var newContents = ""; for(i=0; i<comments.length; i++) { var actor = comments[i].actor; var commentBody = comments[i].object.content; //do the insertion newContents += "<dt><a href='" + actor.url + "'><img src='" + actor.image.url + "' /></a></dt>" + "<dd><a href='" + actor.url + "'>" + actor.displayName + "</a>: " + commentBody + "</dd>"; } insertionElement.innerHTML = "<dl>" + newContents + "</dl> <p class='g-commentlink'>Please comment on the <a href='" + activity.url + "'>Google+ activity</a></p>"; }
source share