projects
/
harrypotter-wikipedia-cdsw
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
682b2b0
)
updated for new version of catscan
author
Benjamin Mako Hill
<mako@atdot.cc>
Mon, 2 Nov 2015 00:35:45 +0000
(16:35 -0800)
committer
Benjamin Mako Hill
<mako@atdot.cc>
Mon, 2 Nov 2015 00:35:45 +0000
(16:35 -0800)
build_hpwp_dataset.py
patch
|
blob
|
history
diff --git
a/build_hpwp_dataset.py
b/build_hpwp_dataset.py
index 97cc5338251324b76ecef0467313dc31141b90ed..62f7e4fd447bafbff39b4c8d78f9fe149c0efd87 100644
(file)
--- 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)
#
# 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/catscan
2
/catscan2.php"
+url_catscan = "http://tools.wmflabs.org/catscan
3
/catscan2.php"
parameters = {'depth' : 10,
'categories' : category,
parameters = {'depth' : 10,
'categories' : category,
@@
-96,7
+96,7
@@
parameters = {'depth' : 10,
r = requests.get(url_catscan, params=parameters)
articles_json = r.json()
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")
# open a file to write all the output
output = open("hp_wiki.tsv", "w", encoding="utf-8")
Benjamin Mako Hill
||
Want to submit a patch?