鉴于帖子的网址,我正在尝试找到一种方法来获取 google+ 帖子的“分享”计数。
我搜索了stackoverflow,发现只有pos.plusone.get
获得加一计数的方法,而不是共享:
url = "https://plus.google.com/+JohnBattelle/posts/bpxzZb3z5qt"
mh = { method: "pos.plusones.get", id: "p", params: {nolog: true, id: url, source: "widget", userId: "@viewer", groupId: "@self"}, jsonrpc: "2.0", key: "p", apiVersion: "v1"}
r = Typhoeus::Request.new("https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ", method: :post, body: mh.to_json, headers: {"Accept" => "application/json", "Content-type" => "application/json" } )
x = r.run
x.body
回报:
"{\n \"id\": \"p\",\n \"result\": {\n \"kind\": \"pos#plusones\",\n \"id\": \"https://plus.google.com/+JohnBattelle/posts/bpxzZb3z5qt\",\n \"isSetByViewer\": false,\n \"metadata\": {\n \"type\": \"URL\",\n \"globalCounts\": {\n \"count\": 58.0\n }\n },\n \"abtk\": \"AEIZW7Sct6yKBGo7SA4ZRVvfJerD/H1RhuV/6YxCYfQC6HfEId6oDE8z43pCF4BPmRuxktNaxNSj\"\n }\n}\n"
我尝试使用方法参数的不同值发送散列“mh”,但每个都返回Not Found。我尝试的各种值是:
pos.plus_shares.get
pos.shares.get
pos.plus_share.get
pos.public.shares.get
有没有人能够找到一种方法来获取股票数量?