How to get like status of google+ button on website or url? I am using PHP.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
if you are trying to get the statistics of your website's +1s, google's webmaster tools will provide the data.
Unfortunately this isn't quite possible. Neither the REST API nor the PlusOne button itselfs provides a method to check whether a user has +1'd the page or not. Furthermore, if you're using PHP, the user would have to authenticate himself first (using OAuth), so that's probably not what you want, anyway.
What you can do, however, is using Javascript to catch actions of the current visitor. You can specify a
callback
parameter when creating the +1 button which will be called everytime when the user clicks on the +1 button (source).While this approach doesn't provide you any information about who the user is (in terms of Google+ user), you could track his actions on your server using a cookie or something else. Or, if that's sufficient, just use the information for the duration of his stay.
YOu can get this from +1 metric menu in left panel in webmaster tools