21 lines
805 B
Text
21 lines
805 B
Text
ClearAll[ImportAll]
|
|
ImportAll[lang_String] :=
|
|
Module[{data, continue, cmcontinue, extra, xml, next},
|
|
data = {};
|
|
continue = True;
|
|
cmcontinue = "";
|
|
While[continue,
|
|
extra = If[cmcontinue =!= "", "&cmcontinue=" <> cmcontinue, ""];
|
|
xml = Import["http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:" <> lang <> "&cmlimit=500&format=xml" <> extra, "XML"];
|
|
AppendTo[data, Cases[xml, XMLElement["cm", _, {}], \[Infinity]]];
|
|
next = Flatten[Cases[xml, {"cmcontinue" -> _}, \[Infinity]]];
|
|
If[Length[next] > 0,
|
|
next = First[next];
|
|
cmcontinue = "cmcontinue" /. next;
|
|
,
|
|
continue = False;
|
|
];
|
|
];
|
|
Cases[Flatten[data], HoldPattern["title" -> x_] :> x, \[Infinity]]
|
|
]
|
|
Complement[ImportAll["Programming_Tasks"], ImportAll["Mathematica"]]
|