I am running a Rails 3 app with ruby 1.9.3-p448 and using the Curl::Easy
library to scrape some images when a user includes a url in a post.
lets set:
url_b
= "http://www.cbssports.com/golf/eye-on-golf/24563578/us-open-infographic-shows-path-to-championship"
When I use the user-agent 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0' I find that curling url_a
works fine but url_b
returns a compressed response.
When I use the user-agent 'Mozilla/5.0' the above url_a
yields this error:
Curl::Err::GotNothingError: Curl::Err::GotNothingError
while curling url_b
gives an uncompressed response (which is what I desire).
Anyone know why this is happening and what would be a good user-agent choice to be able to return good, uncompressed responses from both urls?
I'm a bit out of my comfort zone here, so please ask me for any more information you need.
Thanks!