From: Benjamin Mako Hill Date: Mon, 2 Nov 2015 00:35:45 +0000 (-0800) Subject: updated for new version of catscan X-Git-Url: https://projects.mako.cc/source/harrypotter-wikipedia-cdsw/commitdiff_plain/2da9c10d579b36f785f90fd2aebc57b3b0c3e876 updated for new version of catscan --- diff --git a/build_hpwp_dataset.py b/build_hpwp_dataset.py index 97cc533..62f7e4f 100644 --- a/build_hpwp_dataset.py +++ b/build_hpwp_dataset.py @@ -85,7 +85,7 @@ category = "Harry Potter" # # The following requests call basically does the same thing as this string: # "http://tools.wmflabs.org/catscan2/catscan2.php?depth=10&categories={0}&doit=1&format=json".format(category) -url_catscan = "http://tools.wmflabs.org/catscan2/catscan2.php" +url_catscan = "http://tools.wmflabs.org/catscan3/catscan2.php" parameters = {'depth' : 10, 'categories' : category, @@ -96,7 +96,7 @@ parameters = {'depth' : 10, r = requests.get(url_catscan, params=parameters) articles_json = r.json() -articles = articles_json["*"][0]["a"]["*"] +articles = articles_json["*"][0]["*"] # open a file to write all the output output = open("hp_wiki.tsv", "w", encoding="utf-8")