X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fwebcollage;h=a630e9938663fa6b20d0ab04b649cc79d768beea;hp=289cd5be48579ca1acfb80bb809545985ecdbe46;hb=14627f4038ada5d11456f3770090f3c39740d70f;hpb=93f25dc6827112d98b8b855ea85c8f5eb8123086 diff --git a/hacks/webcollage b/hacks/webcollage index 289cd5be..a630e993 100755 --- a/hacks/webcollage +++ b/hacks/webcollage @@ -1,6 +1,6 @@ #!/usr/local/bin/perl5 -w # -# webcollage, Copyright (c) 1999 by Jamie Zawinski +# webcollage, Copyright (c) 1999, 2000 by Jamie Zawinski # This program decorates the screen with random images from the web. # One satisfied customer described it as "a nonstop pop culture brainbath." # @@ -27,7 +27,7 @@ require POSIX; use Fcntl ':flock'; # import LOCK_* constants -my $version = q{ $Revision: 1.54 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.60 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $copyright = "WebCollage $version, Copyright (c) 1999" . " Jamie Zawinski \n" . " http://www.jwz.org/xscreensaver/\n"; @@ -96,7 +96,10 @@ my $delay = 0; my $wordlist = "/usr/dict/words"; if (!-r $wordlist) { - $wordlist = "/usr/share/lib/dict/words"; # irix + $wordlist = "/usr/share/dict/words"; # BSD +} +if (!-r $wordlist) { + $wordlist = "/usr/share/lib/dict/words"; # Irix } die "$wordlist doesn't exist!\n" unless (-r $wordlist); @@ -665,6 +668,8 @@ sub pick_from_image_randomizer { # s/Result [Pp]ages:.*$//s; # trim off page footer # s/^.*?IMAGE RESULTS//s; # trim off page header + s/Have you tried these resources.*//s; # let's try it again + s/[\r\n\t ]+/ /g; s/( 3 ) { print STDERR "$progname: skipping corbis URL: $u\n"; } @@ -804,7 +816,6 @@ my $count_4 = 0; sub pick_image { my ( $timeout ) = @_; - my $r = int(rand(100)); my ($base, $img, $source, $total, $count); @@ -819,7 +830,7 @@ sub pick_image { $total = ++$total_1; $count = ++$count_1 if $img; - } elsif ($r < 70) { + } elsif ($r < 65) { ($base, $img, $source) = pick_from_image_randomizer ($timeout, 3); $total = ++$total_4; $count = ++$count_4 if $img; @@ -1207,7 +1218,7 @@ sub x_output { } elsif ((@_ = jpeg_size ($body))) { ($iw, $ih) = @_; $cmd = "djpeg |"; - } elsif ($body =~ "^P\d\n(\d+) (\d+)\n") { + } elsif ($body =~ m/^P\d\n(\d+) (\d+)\n/) { $iw = $1; $ih = $2; $cmd = "";