

def serps(keyword='', topkeyword=''):
    'Return non-customized JSON search results for keyword from Google.'
    if topkeyword:
        keyword = topkeyword
    elif (not keyword):
        return None
    times = 6
    api = 'http://ajax.googleapis.com/ajax/services/search/web'
    returnme = []
    for start in [(8 * n) for n in range(0, times)]:
        pdict = {
            'rsz': 'large',
            'v': '1.0',
            'q': keyword,
            'start': start,
        }
        respobj = requests.get(api, params=pdict, timeout=5)
        returnme.append(respobj.json())
        time.sleep(1)
    return json.dumps(returnme)

dataset/ETHPy150Open miklevin/pipulate/common.py serps/original