33import pprint
44import time
55
6- print "Calling article API endpoint on the url: http://shichuan.github.io/javascript-patterns/...\n "
6+ print ( "Calling article API endpoint on the url: http://shichuan.github.io/javascript-patterns/...\n " )
77diffbot = DiffbotClient ()
88token = API_TOKEN
99url = "http://shichuan.github.io/javascript-patterns/"
1010api = "article"
1111response = diffbot .request (url , token , api )
12- print "\n Printing response:\n "
12+ print ( "\n Printing response:\n " )
1313pp = pprint .PrettyPrinter (indent = 4 )
14- print pp .pprint (response )
14+ print ( pp .pprint (response ) )
1515
16- print
17- print "Calling article API endpoint with fields specified on the url: http://shichuan.github.io/javascript-patterns/...\n "
16+ print ()
17+ print ( "Calling article API endpoint with fields specified on the url: http://shichuan.github.io/javascript-patterns/...\n " )
1818diffbot = DiffbotClient ()
1919token = API_TOKEN
2020url = "http://shichuan.github.io/javascript-patterns/"
2121api = "article"
2222response = diffbot .request (url , token , api , fields = ['title' , 'type' ])
23- print "\n Printing response:\n "
23+ print ( "\n Printing response:\n " )
2424pp = pprint .PrettyPrinter (indent = 4 )
25- print pp .pprint (response )
25+ print ( pp .pprint (response ) )
2626
27- print
28- print "Calling frontpage API endpoint on the url: http://www.huffingtonpost.com/...\n "
27+ print ()
28+ print ( "Calling frontpage API endpoint on the url: http://www.huffingtonpost.com/...\n " )
2929diffbot = DiffbotClient ()
3030token = API_TOKEN
3131url = "http://www.huffingtonpost.com/"
3232api = "frontpage"
3333response = diffbot .request (url , token , api )
34- print "\n Printing response:\n "
34+ print ( "\n Printing response:\n " )
3535pp = pprint .PrettyPrinter (indent = 4 )
36- print pp .pprint (response )
36+ print ( pp .pprint (response ) )
3737
38- print
39- print "Calling product API endpoint on the url: http://www.overstock.com/Home-Garden/iRobot-650-Roomba-Vacuuming-Robot/7886009/product.html...\n "
38+ print ()
39+ print ( "Calling product API endpoint on the url: http://www.overstock.com/Home-Garden/iRobot-650-Roomba-Vacuuming-Robot/7886009/product.html...\n " )
4040diffbot = DiffbotClient ()
4141token = API_TOKEN
4242url = "http://www.overstock.com/Home-Garden/iRobot-650-Roomba-Vacuuming-Robot/7886009/product.html"
4343api = "product"
4444response = diffbot .request (url , token , api )
45- print "\n Printing response:\n "
45+ print ( "\n Printing response:\n " )
4646pp = pprint .PrettyPrinter (indent = 4 )
47- print pp .pprint (response )
47+ print ( pp .pprint (response ) )
4848
49- print
50- print "Calling image API endpoint on the url: http://www.google.com/...\n "
49+ print ()
50+ print ( "Calling image API endpoint on the url: http://www.google.com/...\n " )
5151diffbot = DiffbotClient ()
5252token = API_TOKEN
5353url = "http://www.google.com/"
5454api = "image"
5555response = diffbot .request (url , token , api )
56- print "\n Printing response:\n "
56+ print ( "\n Printing response:\n " )
5757pp = pprint .PrettyPrinter (indent = 4 )
58- print pp .pprint (response )
58+ print ( pp .pprint (response ) )
5959
60- print
61- print "Calling classifier API endpoint on the url: http://www.twitter.com/...\n "
60+ print ()
61+ print ( "Calling classifier API endpoint on the url: http://www.twitter.com/...\n " )
6262diffbot = DiffbotClient ()
6363token = API_TOKEN
6464url = "http://www.twitter.com/"
6565api = "analyze"
6666response = diffbot .request (url , token , api )
67- print "\n Printing response:\n "
67+ print ( "\n Printing response:\n " )
6868pp = pprint .PrettyPrinter (indent = 4 )
69- print pp .pprint (response )
69+ print ( pp .pprint (response ) )
7070
71- print "Create a new crawl of http://support.diffbot.com/ using the Article API...\n "
71+ print ( "Create a new crawl of http://support.diffbot.com/ using the Article API...\n " )
7272token = API_TOKEN
7373seeds = "http://support.diffbot.com"
7474api = "article"
7575name = "testCrawl"
7676diffbot = DiffbotCrawl (token , name , seeds = seeds , api = api )
7777time .sleep (5 )
7878status = diffbot .status ()
79- print "\n Printing status:\n "
79+ print ( "\n Printing status:\n " )
8080pp = pprint .PrettyPrinter (indent = 4 )
81- print pp .pprint (status )
82- print "\n Deleting test crawl.\n "
81+ print ( pp .pprint (status ) )
82+ print ( "\n Deleting test crawl.\n " )
8383diffbot .delete ()
0 commit comments