Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
|
|
@ -0,0 +1,16 @@
|
|||
import "os" for Process
|
||||
import "./pattern" for Pattern
|
||||
|
||||
var url = "https://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml"
|
||||
var content = Process.read("curl -s -L \"%(url)\"") // url needs quotes as it contains '&'
|
||||
var p = Pattern.new("title/=\"[+1^\"]\"")
|
||||
var matches = p.findAll(content)
|
||||
for (m in matches.take(25)) { // limit to first 25
|
||||
var title = m.capsText[0].replace("'", "'").replace(""", "\"")
|
||||
var title2 = title.replace(" ", "_").replace("+", "\%2B")
|
||||
var taskUrl = "https://www.rosettacode.org/w/index.php?title=%(title2)&action=raw"
|
||||
var taskContent = Process.read("curl -s -L \"%(taskUrl)\"")
|
||||
var lines = taskContent.split("\n")
|
||||
var count = lines.count { |line| line.trim().startsWith("=={{header|") }
|
||||
System.print("%(title) : %(count) examples")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue