pp = pprint.PrettyPrinter(indent=4)
print(pp.pprint(response))

print()
print(
    "Calling classifier API endpoint on the url: http://www.twitter.com/...\n")
diffbot = DiffbotClient()
token = API_TOKEN
url = "http://www.twitter.com/"
api = "analyze"
response = diffbot.request(url, token, api)
print("\nPrinting response:\n")
pp = pprint.PrettyPrinter(indent=4)
print(pp.pprint(response))

print(
    "Create a new crawl of http://support.diffbot.com/ using the Article API...\n"
)
token = API_TOKEN
seeds = "http://support.diffbot.com"
api = "article"
name = "testCrawl"
diffbot = DiffbotCrawl(token, name, seeds=seeds, api=api)
time.sleep(5)
status = diffbot.status()
print("\nPrinting status:\n")
pp = pprint.PrettyPrinter(indent=4)
print(pp.pprint(status))
print("\nDeleting test crawl.\n")
diffbot.delete()
Exemple #2
0
api = "image"
response = diffbot.request(url, token, api)
print "\nPrinting response:\n"
pp = pprint.PrettyPrinter(indent=4)
print pp.pprint(response)

print
print "Calling classifier API endpoint on the url: http://www.twitter.com/...\n"
diffbot = DiffbotClient()
token = API_TOKEN
url = "http://www.twitter.com/"
api = "analyze"
response = diffbot.request(url, token, api)
print "\nPrinting response:\n"
pp = pprint.PrettyPrinter(indent=4)
print pp.pprint(response)

print "Create a new crawl of http://support.diffbot.com/ using the Article API...\n"
token = API_TOKEN
seeds = "http://support.diffbot.com"
api = "article"
name = "testCrawl"
diffbot = DiffbotCrawl(token, name, seeds=seeds, api=api)
time.sleep(5)
status = diffbot.status()
print "\nPrinting status:\n"
pp = pprint.PrettyPrinter(indent=4)
print pp.pprint(status)
print "\nDeleting test crawl.\n"
diffbot.delete()