Mar 2 2011

Earl - webified strings

Earl makes Ruby strings do web stuff like extracting urls or finding redirect destinations.

text = "Blah blah http://tinyurl.com/4bnjzbu blah http://tinyurl.com/4tefu9f"

text.urls # => ["http://tinyurl.com/4bnjzbu", "http://tinyurl.com/4tefu9f"]

"http://tinyurl.com/4tefu9f".location # => "http://nutrun.com/"