Beispiel #1
0
def search_images_bing(key, term, min_sz=128):
    client = api('https://api.cognitive.microsoft.com', auth(key))
    return L(
        client.images.search(query=term,
                             count=150,
                             min_height=min_sz,
                             min_width=min_sz).value)
Beispiel #2
0
def search_images_bing(key, term, endpoint='https://api.cognitive.microsoft.com', min_sz=128, count=150):
    client = api(endpoint, auth(key))
    if count > 150:
        result = L(client.images.search(query=term, count=count, offset=None, min_height=min_sz, min_width=min_sz).value) + \
                    L(client.images.search(query=term, count=count-150, offset=count, min_height=min_sz, min_width=min_sz).value)
    else:
        result = L(client.images.search(query=term, count=count, offset=None, min_height=min_sz, min_width=min_sz).value)
    return result