harvest.frink

View or download harvest.frink in plain text format

// Prints out anything that looks like an e-mail address from a URL

default = "http://futureboy.us/"
url = input["Enter a URL [$default]: ", default]

iter = 100
start = now[]

for i = 1 to iter
{
   for line = lines[url]
      for [address] = line =~ %r/(\w+@(?:\w|\.)+\.\w+)/g 
 if (address != "eliasen@mindspring.com")
    println[address]
}

end = now[]
duration = end-start
println[ iter + " tries in " + (duration -> "seconds") ]
println[ (iter/duration -> s^-1) + " iterations per second"]


View or download harvest.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 17649 days, 5 hours, 37 minutes ago.