Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Weather RSS image

by pg (Canon)
on Nov 09, 2005 at 22:07 UTC ( #507229=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Weather RSS image
in thread Weather RSS image

Unfortunately your Perl code does not work. I called binmode() in my code for a reason. Your code would be fine with html files, but with images, it does not work.

If you test your code, you will see that some images are broken (or cannot be recognized as the right format).


Comment on Re^3: Weather RSS image
Re^4: Weather RSS image
by ikegami (Pope) on Nov 09, 2005 at 22:14 UTC

    Huh? getstore calls binmode:

    elsif (!ref($arg)) { # filename open(OUT, ">$arg") or return HTTP::Response->new(&HTTP::Status::RC_INTERNAL_SERV +ER_ERROR, "Cannot write to '$arg': $!"); binmode(OUT);

    source

    Call stack:

    • LWP::Protocol::collect
    • LWP::Protocol::http::request
    • LWP::UserAgent::send_request
    • LWP::UserAgent::simple_request
    • LWP::UserAgent::request
    • LWP::Simple::getstore

    It's not a recent addition either. The version of libwww-perl packaged with ActiveState Perl v5.6.1 does the same thing.

    I've successfully downloaded all the images on a Windows system (where binmode would matter) using getstore and ActiveState Perl v5.6.1.

Re^4: Weather RSS image
by davidrw (Prior) on Nov 09, 2005 at 22:54 UTC
    It does work (well, i had to do s/Sumple/Simple/ first ;) ) -- and running file weather* afterward shows "GIF image data, version 89a, 52 x 52" for all of them ...
    which images did you see as broken? Did you try re-downloading them?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://507229]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-08-23 07:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls