webspider.frink

View or download webspider.frink in plain text format

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

default = "http://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]
}


View or download 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 17596 days, 22 hours, 2 minutes ago.