如何在没有API密钥的情况下获得jQuery中的Google Plus共享计数?

如何在没有API密钥的情况下获得jQuery中的Google Plus共享计数?,jquery,share,Jquery,Share,我知道。我也知道 但是我试图在我的jQuery插件中实现这一点(没有任何PHP类或其他东西),但没有结果 请提供示例代码帮助。这对我来说很有用: var uri = 'http://your-site.com'; $.ajax({ type: 'POST', url: 'https://clients6.google.com/rpc', processData: true, contentType: 'application/json', data: JSON.string

我知道。我也知道

但是我试图在我的jQuery插件中实现这一点(没有任何PHP类或其他东西),但没有结果

请提供示例代码帮助。

这对我来说很有用:

var uri = 'http://your-site.com';

$.ajax({
  type: 'POST',
  url: 'https://clients6.google.com/rpc',
  processData: true,
  contentType: 'application/json',
  data: JSON.stringify({
    'method': 'pos.plusones.get',
    'id': uri,
    'params': {
      'nolog': true,
      'id': uri,
      'source': 'widget',
      'userId': '@viewer',
      'groupId': '@self'
    },
    'jsonrpc': '2.0',
    'key': 'p',
    'apiVersion': 'v1'
  }),
  success: function(response) {
    $('a.googleplus .counter').text(response.result.metadata.globalCounts.count);
  }
});
这对我很有用:

var uri = 'http://your-site.com';

$.ajax({
  type: 'POST',
  url: 'https://clients6.google.com/rpc',
  processData: true,
  contentType: 'application/json',
  data: JSON.stringify({
    'method': 'pos.plusones.get',
    'id': uri,
    'params': {
      'nolog': true,
      'id': uri,
      'source': 'widget',
      'userId': '@viewer',
      'groupId': '@self'
    },
    'jsonrpc': '2.0',
    'key': 'p',
    'apiVersion': 'v1'
  }),
  success: function(response) {
    $('a.googleplus .counter').text(response.result.metadata.globalCounts.count);
  }
});

这正是我一直在寻找的。看起来谷歌上发生了一些变化,它最近因为某种原因停止了工作。有什么建议吗?这正是我一直在寻找的。看起来谷歌上发生了一些变化,它最近因为某种原因停止了工作。有什么建议吗?