#!/usr/bin/env python
# coding=utf-8
+import encoding_fix
import requests
# get_article_revisions is a function that takes an article title in
#
# 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 = "https://petscan.wmflabs.org/"
parameters = {'depth' : 10,
'categories' : category,
# for every article
for article in articles:
+ # skip this until it's an article
+ if article["namespace"] != 0:
+ continue
# first grab the article's title
- title = article["a"]["title"]
+ title = article["title"]
+ print(title)
# get the list of revisions from our function and then iterate through it,
# printing it to our output file
# close the file, we're done here!
output.close()
-
-
+