Rosetta Code/Count examples: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Minor changes (though see Talk Page re encoding of '+')) |
(→{{header|Ada}}: Fixed compilation/run issues.) |
||
Line 47: | Line 47: | ||
Page : Aws.Response.Data; |
Page : Aws.Response.Data; |
||
Uri_Xml : constant String := |
Uri_Xml : constant String := |
||
" |
"https://rosettacode.org/w/api.php?action=query&list=categorymembers" |
||
& |
& |
||
"&format=xml&cmlimit=500&cmtitle=Category:"; |
"&format=xml&cmlimit=500&cmtitle=Category:"; |
||
begin |
begin |
||
Page := Client.Get (Uri_Xml & Category); |
Page := Client.Get (Uri_Xml & Category, Follow_Redirection => True); |
||
if Response.Status_Code (Page) not in Messages.Success then |
if AWS.Response.Status_Code (Page) not in Messages.Success then |
||
raise Client.Connection_Error; |
raise Client.Connection_Error; |
||
end if; |
end if; |
||
Line 85: | Line 85: | ||
Page := |
Page := |
||
Client.Get |
Client.Get |
||
(" |
("https://rosettacode.org/w/index.php?title=" & |
||
Aws.Url.Encode (Title) & |
Aws.Url.Encode (Title) & |
||
"&action=raw" |
"&action=raw", |
||
Follow_Redirection => True); |
|||
Response.Message_Body (Page, File); |
AWS.Response.Message_Body (Page, File); |
||
while not End_Of_File (File) loop |
while not End_Of_File (File) loop |
||
Resources.Get_Line (File, Buffer, Last); |
Resources.Get_Line (File, Buffer, Last); |
||
Line 122: | Line 123: | ||
Output : |
Output : |
||
<pre> |
<pre> |
||
100 doors : |
100 doors : 370 exemples. |
||
⚫ | |||
15 puzzle game : 90 exemples. |
|||
24 game : 30 exemples. |
24 game : 30 exemples. |
||
.... |
.... |
||
</pre> |
|||
Yahoo! search interface : 10 exemples. |
|||
⚫ | |||
Total : 17238 exemples.</pre> |
|||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |