获取的Google+股没有API密钥的每一页? [英] Get Google+ shares without API key for each page?

查看:126
本文介绍了获取的Google+股没有API密钥的每一页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在搜索结果页,我想获得的Google+股份数为每个搜索结果项的通过Ajax的URL。我已经成功地设置了计数功能的Facebook和Twitter的:

On a search result page I would like to get the count of Google+ shares for the URL of each search result item via Ajax. I already managed to set up counting functions for Facebook and Twitter:

    $.getJSON('http://urls.api.twitter.com/1/urls/count.json?url=' + url + '&callback=?', function(data){
        tweets = data.count;
    });

    $.getJSON('https://api.facebook.com/method/links.getStats?urls='+ url+'&format=json', function(data){
        fblikes = data[url].shares;
    });

有关Google+的我也已经找到了解决办法,但这需要的API密钥对每个URL。有没有什么办法来检索的Google+计数,而这样的关键?使用它吨动态加载搜索结果,当然我不能创建一个API密钥为每个搜索结果的网址。

For Google+ I also already found a solution, but this requires the API Key for each URL. Is there any way to retrieve the Google+ count without such a key? Using it for tons of dynamically loaded search results, of course I cannot create an API key for each search result URL.

推荐答案

是的,有可能获得谷歌+1计数。他们通过JSON-RPC POST调用检索。

Yes, it's possible to get Google +1 counts. They are retrieved via a JSON-RPC POST call.

POST网址:

https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ 

帖子正文:

<$c$c>[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"%%URL%%","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]

其中, %% URL %% 是所需的URL。

where %%URL%% is the desired URL.

看一看下面的:

  • Getting google +1 Page shares via AJAX (hidden Api)
  • http://www.sharedcount.com/documentation.php

这篇关于获取的Google+股没有API密钥的每一页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆