S
S
stayHARD2015-09-10 12:47:07
Google
stayHARD, 2015-09-10 12:47:07

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

With it, I should get something like this response:
[{
    "result": { 
        "kind": "pos#plusones", 
        "id": "http://www.codedevelopr.com/", 
        "isSetByViewer": false, 
        "metadata": {
            "type": "URL", 
            "globalCounts": {
                "count": 3097.0
            }
        }
    } ,
    "id": "p"
}]

But I get this:
[{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'}]}}]

What is needed and where to tighten up so that there is access?
Z.Y. a key is created in google developer console and Google + API - Enabled.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question