Is there a Google Plus Comments plugin? (Like Facebook Social Comments, DISQUS or IntenseDebate)?

I was interested and trying to find a Google Plus plugin like Facebook like DISQUS or IntenseDebate?

Does anyone know if he has or has an idea how to do this using the Google+ API?

+4
source share
4 answers
<script src="https://apis.google.com/js/plusone.js"> </script> <div class="g-comments" data-href="http://stackoverflow.com" data-width="580" data-first_party_property="BLOGGER" data-view_type="FILTERED_POSTMOD"> </div> 

https://jsfiddle.net/fdyuhp90/1/

Keyless API

+3
source

Yes, the Wordpress plugin has been available for several months now.

Follow this link: http://wordpress.org/plugins/gplus-comments/

+3
source

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>"; } 
+2
source

No, the Google+ API is currently fully readable and does not have a comment plugin like Facebook does.

+1
source

Source: https://habr.com/ru/post/1396924/


All Articles