Over a million developers have joined DZone.

Inspect A Website Like A String In Ruby

·
Put the following function into your ~/.bash_login (or alternatives).


unset -f inspect_url

function inspect_url() { 
   /usr/bin/curl -L -s --max-time 10 "${@}" | ruby -n -e 'p $_.to_s'
   return 0
}

inspect_url http://www.ruby-forum.com
Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}