/ Published in: Ruby

Only works on valid XML (ie. XHTML, but not HTML). Grabs an alphabetized list of links from the given URL.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
%w[uri net/http rexml/document].each{|l|require l};(REXML::Document.new(Net::HTTP.get_response(URI.parse(ARGV[0])).read_body)).elements.each("//a/@href").collect{|l|l.to_s}.sort!.uniq!.each{|l|puts l}
Comments
