Ejemplo n.º 1
0
This script does also a report, and put it on the wiki.
"""

start = time.time()
print "Start : " + time.strftime("%H:%M:%S", time.localtime(start) )+ "\n"

report = Report()

i = 0
c = Category(Site.site, u"Catégorie:Wikipédia:Tentative d'adoption")
for subCatPage in c.getAllMembersGen():
	a = 0
	subCat = Category(Site.site, subCatPage.title)
	for p in subCat.getAllMembersGen():
		a += 1
		report.parsePage(p.title)
	pprint.pprint( subCatPage.title + ": " + str(a))
	i += a

c = Category(Site.site, "Article orphelin")
for subCatPage in c.getAllMembersGen():
	a = 0
	if subCatPage.title.startswith(u"Catégorie:Article"):
		subCat = Category(Site.site, subCatPage.title)
		for p in subCat.getAllMembersGen():
			a += 1
			report.parsePage(p.title)
				
		pprint.pprint (subCatPage.title + ": " + str(a))
	i += a