title: Ruby Storing wget output in a variable
body: <p>I am using the <code>-O</code> or <code>--output-document</code> option on <code>wget</code> to store get the http from a website. However the -O option requires a file for the output to be stored in and I would like to store it in a variable in my program so that I can manipulate it easier. Is there any way to do this without rereading it in from the file? In essence, I am manually creating a crude cache.</p>
  
  <p><strong>Sample code</strong></p>
  
  <pre><code>#!/usr/bin/ruby
  url= "http://www.google.com"
  whereIWantItStored = `wget #{url} --output-document=outsideFile`
  </code></pre>
  
  <p><strong>Reference</strong>:
  I found this post helpful in using <code>wget</code> within my program: <a href="https://stackoverflow.com/questions/12789369/using-wget-via-ruby-on-rails">Using wget via Ruby on Rails</a></p>