Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
-include "url.sno"
|
||||
http.recl = "K,32767" ;* Read next 32767 characters
|
||||
;* of very long lines.
|
||||
|
||||
rclangs = "http://rosettacode.org/mw/api.php?"
|
||||
+ "format=xml&action=query&generator=categorymembers&"
|
||||
+ "gcmtitle=Category:Programming%20Languages&"
|
||||
+ "gcmlimit=500&prop=categoryinfo"
|
||||
|
||||
languagepat = arb "<page" arb 'title="Category:'
|
||||
+ break('"') . lang arb 'pages="' break('"') . count
|
||||
|
||||
langtable = table(500, 20)
|
||||
|
||||
url.open(.fin, rclangs, http.recl) :s(read)
|
||||
output = "Cannot open rosettacode site." :(end)
|
||||
|
||||
read line = line fin :f(done)
|
||||
get line languagepat = :f(read)
|
||||
langtable<syntaxhighlight lang="text"> = langtable<syntaxhighlight lang="text"> + count :(get)
|
||||
|
||||
done langarray = rsort(langtable,2) :s(write)
|
||||
output = "No languages found." :(end)
|
||||
|
||||
write n = n + 1
|
||||
output = lpad(n ". ", 5) lpad(langarray<n, 2>, 4)
|
||||
+ " - " langarray<n,1> :s(write)
|
||||
|
||||
url.close(.fin)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue