Rosetta Code/Count examples: Difference between revisions

→‎{{header|Lasso}}: adding Lasso count from API & raw file example
(→‎{{header|Lasso}}: adding Lasso count from API & raw file example)
Line 1,080:
</lang>
[[Count programming examples/Java/ScreenScrape|ScreenScrape class]]
 
 
 
=={{header|Lasso}}==
<lang Lasso>local(root = json_deserialize(curl('http://rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=10&format=json')->result))
local(tasks = array, title = string, urltitle = string, thiscount = 0, totalex = 0)
with i in #root->find('query')->find('categorymembers') do => {^
#thiscount = 0
#title = #i->find('title')
#urltitle = #i->find('title')
#urltitle->replace(' ','_')
#title+': '
local(src = curl('http://rosettacode.org/mw/index.php?title='+#urltitle->asBytes->encodeurl+'&action=raw')->result->asString)
#thiscount = (#src->split('=={{header|'))->size - 1
#thiscount < 0 ? #thiscount = 0
#thiscount + ' examples.'
#totalex += #thiscount
'\r'
^}
'Total: '+#totalex+' examples.'</lang>
 
{{out}}
Collecting 10 results:
<pre>100_doors: 176 examples.
24_game: 58 examples.
24_game/Solve: 35 examples.
9_billion_names_of_God_the_integer: 16 examples.
99_Bottles_of_Beer: 210 examples.
A+B: 142 examples.
Abstract_type: 54 examples.
Accumulator_factory: 70 examples.
Ackermann_function: 143 examples.
Active_Directory/Connect: 15 examples.
Total: 919 examples.
</pre>
 
=={{header|Mathematica}}==
140

edits