Answer the question
In order to leave comments, you need to log in
How to get the number (amount) +1 in Google Plus?
Actually there is this code:
import urllib2, json
data = """[{
"method":"pos.plusones.get",
"id":"p",
"params":{
"nolog":true,
"id":"http://www.codedevelopr.com/",
"source":"widget",
"userId":"@viewer",
"groupId":"@self"
},
"jsonrpc":"2.0",
"key":"p",
"apiVersion":"v1"
}]"""
url = "https://clients6.google.com/rpc?key=ключик_здесь"
req = urllib2.Request(url, data, {"Content-Type": "application/json"})
f = urllib2.urlopen(req)
response = f.read()
f.close()
result = json.loads(response)
print result
[{
"result": {
"kind": "pos#plusones",
"id": "http://www.codedevelopr.com/",
"isSetByViewer": false,
"metadata": {
"type": "URL",
"globalCounts": {
"count": 3097.0
}
}
} ,
"id": "p"
}]
[{u'id': u'p', u'error': {u'message': u'Access Not Configured. The API (+1 API) is not enabled for your project. Please use the Google Developers Console to update your configuration.', u'code': 403, u'data': [{u'domain': u'usageLimits', u'message': u'Access Not Configured. The API (+1 API) is not enabled for your project. Please use the Google Developers Console to update your configuration.', u'reason': u'accessNotConfigured', u'extendedHelp': u'https://console.developers.google.com'}]}}]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question