From 2da9c10d579b36f785f90fd2aebc57b3b0c3e876 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Sun, 1 Nov 2015 16:35:45 -0800 Subject: [PATCH] updated for new version of catscan --- build_hpwp_dataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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") -- 2.30.2