How to use gapi.client.request to get Share count of an URL

57 views
Skip to first unread message

Anup singh

unread,
Apr 5, 2016, 2:59:39 AM4/5/16
to Google API JavaScript Client
Hi, I have used gapi.client.rpcRequest to get the share count of a URL, but as we know that gapi.client.rpcRequest is deprecated and system suggest to use  gapi.client.request.

I tried to found the documentation for same, but didn't got success, Can anybody help how can I use gapi.client.request to get facebook share count for any URL.

// Google plus Shares Count
   var params = {
     nolog: true,
     id: $URL,
     source: "widget",
     userId: "@viewer",
     groupId: "@self"
   };
   
   gapi.client.rpcRequest('pos.plusones.get', 'v1', params).execute(function(resp) {
     $('.googleplus__count').text(_sci_social_count_format(resp.result.metadata.globalCounts.count));
   });

I have used above code to fetch share count using rpcRequest.

Thanks

Reply all
Reply to author
Forward
0 new messages