Need help resolving error below. My key and cx work in another Goole sample at the very bottom, but not with google-api-python-client.
Thanks in advance.
Python 2.7.6 Mac OSX 10.10.2
Enabled Content API for Shopping.
Source:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Simple command-line example for Custom Search.
Command-line application that does a search.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import pprint
from discovery import build
def main():
# Build a service object for interacting with the API. Visit
# the Google APIs Console <http://code.google.com/apis/console>
# to get an API key for your own application.
service = build("customsearch", "v1",
developerKey="<my Dev key>")
res = service.cse().list(
q='lectures',
cx='<my cx>',
).execute()
pprint.pprint(res)
if __name__ == '__main__':
main()
========== Last 2 lines of Traceback ==========================
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 141, in init
ciphers)
ssl.SSLError: [Errno 185090050] _ssl.c:343: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
================== Another demo program that does work =====================
import urllib2
import simplejson
url = ('https://ajax.googleapis.com/ajax/services/search/images?' +
'v=1.0&q="ANd9GcThbeJBfVq0WNfRTiPCO4fbjFDvlatP9aMA7r6NzGMTXIv0qMCA8z8i-8yZ"&exactTerms="plus"&fileType="image"&relatedSite="amazon.com"&&userip=<my developer key>')
request = urllib2.Request(url, None, {'Referer': "https://www.google.com/cse/publicurl?cx=<my cx>"})
response = urllib2.urlopen(request)
# Process the JSON string.
results = simplejson.load(response)
print results
Need help resolving error below. My key and cx work in another Goole sample at the very bottom, but not with google-api-python-client.
Thanks in advance.
Python 2.7.6 Mac OSX 10.10.2
Enabled Content API for Shopping.
Source:
========== Last 2 lines of Traceback ==========================
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 141, in init
ciphers)
ssl.SSLError: [Errno 185090050] _ssl.c:343: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
================== Another demo program that does work =====================