webspider.frink

Download or view webspider.frink in plain text format

// Prints a list of all of the URLs (converted to absolute URLs) in a document.

default = "https://futureboy.us/ape/"
url = input["Enter a URL [APE]: ", default]

println[join["\n", findURLs[url]]]

findURLs[u] := 
{
   results = []
   for [rel] read[u] =~ %r/<\s*A\s+[^>]*HREF\s*=\s*"([^ "]+)"/gsi
      results.push[url[u, rel]]

   return sort[results]
}


Download or view webspider.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 19973 days, 4 hours, 12 minutes ago.