DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Inspect A Website Like A String In Ruby

07.09.2008
| 4182 views |
  • submit to reddit
        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