I'm trying to write a Ruby script that will take the Flickr BBCode from an image and only find the actual image link and ignore all of the other stuff.
The BBCode from Flickr looks like this:
<a href="http://www.flickr.com/photos/user/9049969465/" title="Wiggle Wiggle by Anonymous, on Flickr"><img src="https://farm3.staticflickr.com/2864/92917419471_248187_c.jpg" width="800" height="526" alt="Wiggle Wiggle"></a>
and I'm trying to get my output to be just the link, so: https://farm3.staticflickr.com/2864/92917419471_248187_c.jpg
So far, my code is this
#!/usr/bin/ruby
require 'rubygems'
str1 = ""
puts "What text would you like me to use? "
text = gets
text.scan(/"([^"]*)"/) { str1 = $1}
puts str1
and I need to know how I can scan through the input and only find the part that starts at https and ends with the quote. Any help is appreciated