Dark_links provides a module to find broken urls in blobs of html and markdown markup. Original code was written by @srecnig, gemification by @michaelem. If you're wondering, the name dark_links is a reference.
Include DarkLinks::LinkValidator
in your model or plain class and call the provided methods with the text you want to check for broken links.
check_links("The Zelda series has a website: http://www.zelda.com/")
You will reccive a hash containing all the found links as keys and true
(works) or false
(broken) as values.
{ "http://www.zelda.com/" => true }
The gem is available as open source under the terms of the MIT License.