22from config import API_TOKEN
33import pprint
44
5+
6+ print "Calling article API endpoint on the url: http://shichuan.github.io/javascript-patterns/...\n "
57diffbot = DiffbotClient ()
6- url = "http://shichuan.github.io/javascript-patterns/"
78token = API_TOKEN
8- api = "article"
99version = 2
10-
11- print "Calling article API endpoint on the url: http://shichuan.github.io/javascript-patterns/... \n "
10+ url = "http://shichuan.github.io/javascript-patterns/"
11+ api = " article"
1212response = diffbot .request (url , token , api , version = 2 )
1313print "\n Printing response:\n "
1414pp = pprint .PrettyPrinter (indent = 4 )
1515print pp .pprint (response )
1616
17+ print
1718print "Calling article API endpoint with fields specified on the url: http://shichuan.github.io/javascript-patterns/...\n "
19+ diffbot = DiffbotClient ()
20+ token = API_TOKEN
21+ version = 2
22+ url = "http://shichuan.github.io/javascript-patterns/"
23+ api = "article"
1824response = diffbot .request (url , token , api , fields = ['title' , 'type' ], version = 2 )
1925print "\n Printing response:\n "
2026pp = pprint .PrettyPrinter (indent = 4 )
2127print pp .pprint (response )
28+
29+ print
30+ print "Calling frontpage API endpoint on the url: http://www.huffingtonpost.com/...\n "
31+ diffbot = DiffbotClient ()
32+ token = API_TOKEN
33+ version = 2
34+ url = "http://www.huffingtonpost.com/"
35+ api = "frontpage"
36+ response = diffbot .request (url , token , api , version = version )
37+ print "\n Printing response:\n "
38+ pp = pprint .PrettyPrinter (indent = 4 )
39+ print pp .pprint (response )
40+
41+ print
42+ print "Calling product API endpoint on the url: http://www.overstock.com/Home-Garden/iRobot-650-Roomba-Vacuuming-Robot/7886009/product.html...\n "
43+ diffbot = DiffbotClient ()
44+ token = API_TOKEN
45+ version = 2
46+ url = "http://www.overstock.com/Home-Garden/iRobot-650-Roomba-Vacuuming-Robot/7886009/product.html"
47+ api = "product"
48+ response = diffbot .request (url , token , api , version = version )
49+ print "\n Printing response:\n "
50+ pp = pprint .PrettyPrinter (indent = 4 )
51+ print pp .pprint (response )
52+
53+ print
54+ print "Calling image API endpoint on the url: http://www.google.com/...\n "
55+ diffbot = DiffbotClient ()
56+ token = API_TOKEN
57+ version = 2
58+ url = "http://www.google.com/"
59+ api = "image"
60+ response = diffbot .request (url , token , api , version = version )
61+ print "\n Printing response:\n "
62+ pp = pprint .PrettyPrinter (indent = 4 )
63+ print pp .pprint (response )
64+
65+ print
66+ print "Calling classifier API endpoint on the url: http://www.twitter.com/...\n "
67+ diffbot = DiffbotClient ()
68+ token = API_TOKEN
69+ version = 2
70+ url = "http://www.twitter.com/"
71+ api = "analyze"
72+ response = diffbot .request (url , token , api , version = version )
73+ print "\n Printing response:\n "
74+ pp = pprint .PrettyPrinter (indent = 4 )
75+ print pp .pprint (response )
0 commit comments