Skip to content

Instantly share code, notes, and snippets.

@rodrigogiraoserrao
Created August 6, 2020 15:30
Show Gist options
  • Save rodrigogiraoserrao/23c6da18edb0d66b9624a98f120e5225 to your computer and use it in GitHub Desktop.
Save rodrigogiraoserrao/23c6da18edb0d66b9624a98f120e5225 to your computer and use it in GitHub Desktop.
RGS's solution for Problem 3, Phase 2 of 2020 APL competition (see https://mathspp.com/blog/2020-apl-competition for my thoughts on it)
PastTasksBlast ← {
⍝ Function to scrape Dyalog's webpage for the URLs of past year's competition problem statements.
⍝ Monadic function expecting a character vector.
⍝ Assumes HttpCommand is loaded.
⍝ Returns a vector of character vectors.
r ← #.HttpCommand.Get ⍵
r.HttpStatus≠200: 0⍴⊂,' '
base ← ⊃('<base +href="(.*?)"' ⎕S '\1') r.Data
('href="(.*?[.]pdf)"' ⎕S (base,'\1')) r.Data
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment