tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,12 @@
|
|||
import urllib, xml.dom.minidom
|
||||
|
||||
x = urllib.urlopen("http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml")
|
||||
|
||||
tasks = []
|
||||
for i in xml.dom.minidom.parseString(x.read()).getElementsByTagName("cm"):
|
||||
t = i.getAttribute('title').replace(" ", "_")
|
||||
y = urllib.urlopen("http://www.rosettacode.org/w/index.php?title=%s&action=raw" % t.encode('utf-8'))
|
||||
tasks.append( y.read().lower().count("{{header|") )
|
||||
print t.replace("_", " ") + ": %d examples." % tasks[-1]
|
||||
|
||||
print "\nTotal: %d examples." % sum(tasks)
|
||||
Loading…
Add table
Add a link
Reference in a new issue