'Returns a list of results from Google for the given query.
- type : SEARCH,
- start: maximum 100 results => start 1-10 with count=10,
- count: maximum 10,
There is a daily limit of 10,000 queries. Google Custom Search is a paid service.'

def search(self, query, type=SEARCH, start=1, count=10, sort=RELEVANCY, size=None, cached=True, **kwargs):

    if (type != SEARCH):
        raise SearchEngineTypeError
    if ((not query) or (count < 1) or (start < 1) or (start > (100 / count))):
        return Results(GOOGLE, query, type)
    url = URL(GOOGLE, query={'key': (self.license or GOOGLE_LICENSE), 'cx': GOOGLE_CUSTOM_SEARCH_ENGINE, 'q': query, 'start': (1 + ((start - 1) * count)), 'num': min(count, 10), 'alt': 'json'})
    if (self.language is not None):
        url.query['lr'] = ('lang_' + self.language)
    kwargs.setdefault('unicode', True)
    kwargs.setdefault('throttle', self.throttle)
    data = url.download(cached=cached, **kwargs)
    data = json.loads(data)
    if (data.get('error', {}).get('code') == 403):
        raise SearchEngineLimitError
    results = Results(GOOGLE, query, type)
    results.total = int((data.get('queries', {}).get('request', [{}])[0].get('totalResults') or 0))
    for x in data.get('items', []):
        r = Result(url=None)
        r.url = self.format(x.get('link'))
        r.title = self.format(x.get('title'))
        r.text = self.format(x.get('htmlSnippet').replace('<br>        ', '').replace('<b>...</b>', '...'))
        r.language = (self.language or '')
        r.date = ''
        if (not r.date):
            m = RE_GOOGLE_DATE.match(r.text)
            if m:
                r.date = m.group(1)
                r.text = ('...' + r.text[len(m.group(0)):])
        results.append(r)
    return results
