Rebol [ title: "Rosetta code: Rosetta_Code/Count_examples" file: %Rosetta_Code-Count_examples.r3 url: https://rosettacode.org/wiki/Rosetta_Code/Count_examples ] ;; Import caching and HTML decoding utilities import thru-cache import html-entities ;; Set HTTPS request timeout to 30 seconds system/schemes/https/spec/timeout: 30 get-all-task-titles: function [ "Scrapes all Rosetta Code task titles" ][ ;; Build the base API URL for querying the Programming Tasks category base-url: rejoin [ https://rosettacode.org/w/api.php "?action=query&format=xml&list=categorymembers&cmlimit=500" "&cmtitle=Category:Programming_Tasks" ] que: to block! base-url ;; Initialize queue with the starting URL titles: copy [] ;; Will hold task titles as [pageid title] ;; Process each URL in the queue (handles pagination across subcategory pages) while [not empty? que][ ;; Dequeue and read the next URL url: take que print ["Reading:" as-blue find/tail url "&cmtitle="] xml: read-thru/string url cmcontinue: none ;; Will hold the "next page" subcategory token, if present parse xml [ ;; Try to extract the pagination continuation token opt [ thru { ;; Extract pageid and title from each element any [ thru {