title: Ruby open-uri redirect forbidden
body: <p>I have this simple html parser(for learning purposes) that I have been working on.:</p>
  
  <pre><code>require 'open-uri'
  puts "Enter URL to parse HTML: "
  url = gets.chomp
  puts "Enter tag to parse from: "
  tag = gets.chomp
  response = open(url).read
  title1 = response.index(tag)
  title2 = response.index(tag.insert(1,'/')) -1
  result = response[(title1 + tag.length - 1)..title2]
  print result 
  </code></pre>
  
  <p>and when I input <code>http://twitter.com</code>, I get this error message:</p>
  
  <pre><code>ERROR: `open_loop': redirection forbidden: http://twitter.com -&gt; https://twitter.com/ (RuntimeError)
  from /usr/local/rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/open-uri.rb:149:in `open_uri'
  from /usr/local/rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/open-uri.rb:704:in `open'
  from /usr/local/rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/open-uri.rb:34:in `open'
  from /home/ubuntu/workspace/htmlparse.rb:6:in `&lt;main&gt;' 
  </code></pre>
  
  <p>Any advise or help? Im new to Ruby and I am aware of other html parsing modules, but Im doing this to learn Ruby basics. Thanks.</p>