#! lua
-- URL grab

 local url_pat = "<[aA]%s+[hH][rR][eE][fF]%s*=%s*\"(https?://[^%c\"]*)\""
 local used = { }
 io.input (arg[1])
 local s = io.read "*a"
 io.input ( )
 for url in s:gmatch (url_pat) do
  if not used[url] then
    print (url)
    used[url] = true
  end -- if
 end -- for


