Rosetta Code/Tasks without examples: Difference between revisions
Rosetta Code/Tasks without examples (view source)
Revision as of 22:06, 6 December 2021
, 2 years agojulia example
m (added whitespace and bullets for the task requirements.) |
(julia example) |
||
Line 337:
}
}</lang>
=={{header|Julia}}==
<trans|Go}}
<lang julia>using HTTP
function gettaskdescriptions(numtoprint = 3)
tasks = String[]
page = "http://rosettacode.org/wiki/Category:Programming_Tasks"
body = String(HTTP.get(page).body)
for m in eachmatch(r"<li><a href=\"/wiki/([^\"]+)\"", body)
push!(tasks, m.captures[1])
end
base = "http://rosettacode.org/wiki/"
for (i, task) in enumerate(tasks)
page = base * task
body = String(HTTP.get(page).body)
m = match(r"using any language you may know.</div>(.+)<div id=\"toc\""s, body)
m != nothing && println(m.captures[1], "\n", "="^80, "\n")
i >= numtoprint && break
sleep(rand(3:7)) # wait 5 +/- 2 seconds before processing next task
end
end
gettaskdescriptions()
<lang>
=={{header|Kotlin}}==
|