task
Essentially, count the number of occurrences of =={{header| on each task page.

Output:

100 doors: 20 examples.
99 Bottles of Beer: 29 examples.
Abstract type: 10 examples.

Total: X examples.
For a full output, updated periodically, see Rosetta Code/Count examples/Full list.

You'll need to use the Media Wiki API, which you can find out about locally, here, or in Media Wiki's API documentation at, API:Query

 
import tango.io.Stdout;
import tango.net.http.HttpClient;
import tango.net.http.HttpHeaders;
import tango.text.xml.Document;
import tango.text.Util;
 
alias HttpHeader.ContentLength CL;
 
auto url = "http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml";
void main()
{
    auto client = new HttpClient (HttpClient.Get, url);
    client.open();
    char[] mainData, tmp;
    int total, i;
 
    void cat(void[] content) { tmp ~= cast(char[]) content; }
 
    if (client.isResponseOK) {
        client.read(&cat, client.getResponseHeaders.getInt(CL));
        mainData = tmp;
        tmp = null;
 
        auto doc = new Document!(char);
        doc.parse(mainData);
        foreach (n; doc.query.descendant("cm").attribute("title")) {
            auto subClient = new HttpClient(HttpClient.Get, 
                    "http://www.rosettacode.org/w/index.php?title=" ~
                    replace(n.value.dup, ' ', '_') ~ "&action=raw");
            subClient.open();
            if (! subClient.isResponseOK) {
                Stderr (client.getResponse);
                 break;
            }
            subClient.read(&cat, subClient.getResponseHeaders.getInt(CL));
            foreach (segment; patterns(cast(char[])tmp, "=={{header|")) i++;
            --i;
            if (i) --i;
            Stdout.formatln ("{0,-40} - {}", n.value, i);
            total += i;
            tmp = null;
            i = 0;
        }
        Stdout("total examples: ", total).newline;
    } else {
        Stderr (client.getResponse);
    }
}
 