Never been to DZone Snippets before?

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

About this user

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Inspect a website like a string in Ruby

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

   1  
   2  unset -f inspect_url
   3  
   4  function inspect_url() { 
   5     /usr/bin/curl -L -s --max-time 10 "${@}" | ruby -n -e 'p $_.to_s'
   6     return 0
   7  }
   8  
   9  inspect_url http://www.ruby-forum.com
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS