Posted By

burke on 08/03/07


xhtml oneliner

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Get links from a URL

 / Published in: Ruby

Only works on valid XML (ie. XHTML, but not HTML). Grabs an alphabetized list of links from the given URL.

  1. %w[uri net/http rexml/document].each{|l|require l};([0])).read_body)).elements.each("//a/@href").collect{|l|l.to_s}.sort!.uniq!.each{|l|puts l}

Report this snippet  

You need to login to post a comment.