projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ftp://ftp.swin.edu.au/slackware/slackware-9.1/source/xap/xscreensaver/xscreensaver...
[xscreensaver]
/
hacks
/
webcollage
diff --git
a/hacks/webcollage
b/hacks/webcollage
index 4b41ac16534580c5e9036ffaa01407e9c5edecce..42f20ab4b65345d443974399e76c21f91e838a45 100755
(executable)
--- a/
hacks/webcollage
+++ b/
hacks/webcollage
@@
-1,6
+1,6
@@
#!/usr/bin/perl -w
#
#!/usr/bin/perl -w
#
-# webcollage, Copyright (c) 1999-200
2
by Jamie Zawinski <jwz@jwz.org>
+# webcollage, Copyright (c) 1999-200
3
by Jamie Zawinski <jwz@jwz.org>
# This program decorates the screen with random images from the web.
# One satisfied customer described it as "a nonstop pop culture brainbath."
#
# This program decorates the screen with random images from the web.
# One satisfied customer described it as "a nonstop pop culture brainbath."
#
@@
-15,8
+15,8
@@
# To run this as a display mode with xscreensaver, add this to `programs':
#
# To run this as a display mode with xscreensaver, add this to `programs':
#
-#
default-n: webcollage -root \n\
-#
default-n: webcollage -root -filter 'vidwhacker -stdin -stdout' \n\
+#
webcollage -root
+#
webcollage -root -filter 'vidwhacker -stdin -stdout'
# If you have the "driftnet" program installed, webcollage can display a
# If you have the "driftnet" program installed, webcollage can display a
@@
-27,7
+27,7
@@
# Driftnet is available here: http://www.ex-parrot.com/~chris/driftnet/
# Use it like so:
#
# Driftnet is available here: http://www.ex-parrot.com/~chris/driftnet/
# Use it like so:
#
-#
default-n: webcollage -root -driftnet \n\
+#
webcollage -root -driftnet
#
# Driftnet is the Unix implementation of the MacOS "EtherPEG" program.
#
# Driftnet is the Unix implementation of the MacOS "EtherPEG" program.
@@
-53,7
+53,7
@@
use bytes; # Larry can take Unicode and shove it up his ass sideways.
my $progname = $0; $progname =~ s@.*/@@g;
my $progname = $0; $progname =~ s@.*/@@g;
-my $version = q{ $Revision: 1.10
2
$ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
+my $version = q{ $Revision: 1.10
7
$ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
my $copyright = "WebCollage $version, Copyright (c) 1999-2002" .
" Jamie Zawinski <jwz\@jwz.org>\n" .
" http://www.jwz.org/xscreensaver/\n";
my $copyright = "WebCollage $version, Copyright (c) 1999-2002" .
" Jamie Zawinski <jwz\@jwz.org>\n" .
" http://www.jwz.org/xscreensaver/\n";
@@
-61,9
+61,8
@@
my $copyright = "WebCollage $version, Copyright (c) 1999-2002" .
my @search_methods = ( 77, "altavista", \&pick_from_alta_vista_random_link,
my @search_methods = ( 77, "altavista", \&pick_from_alta_vista_random_link,
- 12, "yahoorand", \&pick_from_yahoo_random_link,
- 9, "lycos", \&pick_from_lycos_text,
- 2, "yahoonews", \&pick_from_yahoo_news_text,
+ 14, "yahoorand", \&pick_from_yahoo_random_link,
+ 9, "yahoonews", \&pick_from_yahoo_news_text,
# Alta Vista has a new "random link" URL now.
# They added it specifically to better support webcollage!
# Alta Vista has a new "random link" URL now.
# They added it specifically to better support webcollage!
@@
-85,11
+84,15
@@
my @search_methods = ( 77, "altavista", \&pick_from_alta_vista_random_link,
# data as Lycos.
#
# 0, "hotbot", \&pick_from_hotbot_text,
# data as Lycos.
#
# 0, "hotbot", \&pick_from_hotbot_text,
+
+ # Eh, Lycos sucks anyway.
+ # 0, "lycos", \&pick_from_lycos_text,
);
# programs we can use to write to the root window (tried in ascending order.)
#
my @root_displayers = (
);
# programs we can use to write to the root window (tried in ascending order.)
#
my @root_displayers = (
+ "xscreensaver-getimage -root -file",
"chbg -once -xscreensaver -max_size 100",
"xv -root -quit -viewonly +noresetroot -quick24 -rmode 5" .
" -rfg black -rbg black",
"chbg -once -xscreensaver -max_size 100",
"xv -root -quit -viewonly +noresetroot -quick24 -rmode 5" .
" -rfg black -rbg black",
@@
-265,6
+268,7
@@
sub get_document_1 {
my $port2 = $port;
if ($http_proxy) {
$serverstring = $http_proxy if $http_proxy;
my $port2 = $port;
if ($http_proxy) {
$serverstring = $http_proxy if $http_proxy;
+ $serverstring =~ s@^[a-z]+://@@;
($them2,$port2) = split(/:/, $serverstring);
$port2 = 80 unless $port2;
}
($them2,$port2) = split(/:/, $serverstring);
$port2 = 80 unless $port2;
}
@@
-311,7
+315,8
@@
sub get_document_1 {
my $user_agent = "$progname/$version";
my $user_agent = "$progname/$version";
- if ($url =~ m@^http://www\.altavista\.com/@) {
+ if ($url =~ m@^http://www\.altavista\.com/@ ||
+ $url =~ m@^http://random\.yahoo\.com/@) {
# block this, you turkeys.
$user_agent = "Mozilla/4.76 [en] (X11; U; Linux 2.2.16-22 i686; Nav)";
}
# block this, you turkeys.
$user_agent = "Mozilla/4.76 [en] (X11; U; Linux 2.2.16-22 i686; Nav)";
}
@@
-334,6
+339,11
@@
sub get_document_1 {
print S $hdrs;
my $http = <S> || "";
print S $hdrs;
my $http = <S> || "";
+ # Kludge: the Yahoo Random Link is now returning as its first
+ # line "Status: 301" instead of "HTTP/1.0 301 Found". Fix it...
+ #
+ $http =~ s@^Status:\s+(\d+)\b@HTTP/1.0 $1@i;
+
$_ = $http;
s/[\r\n]+$//s;
LOG ($verbose_http, " <== $_");
$_ = $http;
s/[\r\n]+$//s;
LOG ($verbose_http, " <== $_");
@@
-419,6
+429,7
@@
sub get_document {
if ( $http =~ m@^HTTP/[0-9.]+ 30[123]@ ) {
$_ = $head;
if ( $http =~ m@^HTTP/[0-9.]+ 30[123]@ ) {
$_ = $head;
+
my ( $location ) = m@^location:[ \t]*(.*)$@im;
if ( $location ) {
$location =~ s/[\r\n]$//;
my ( $location ) = m@^location:[ \t]*(.*)$@im;
if ( $location ) {
$location =~ s/[\r\n]$//;
@@
-597,7
+608,7
@@
sub pick_image_from_body {
} elsif ( m/^(img|a) .*(src|href) ?= ?\"? ?(.*?)[ >\"]/io ) {
} elsif ( m/^(img|a) .*(src|href) ?= ?\"? ?(.*?)[ >\"]/io ) {
- my $was_inline = (
"$1" eq "a" || "$1" eq "A"
);
+ my $was_inline = (
! ( "$1" eq "a" || "$1" eq "A" )
);
my $link = $3;
my ( $width ) = m/width ?=[ \"]*(\d+)/oi;
my ( $height ) = m/height ?=[ \"]*(\d+)/oi;
my $link = $3;
my ( $width ) = m/width ?=[ \"]*(\d+)/oi;
my ( $height ) = m/height ?=[ \"]*(\d+)/oi;
@@
-979,7
+990,7
@@
sub pick_image_from_pages {
############################################################################
# yahoorand
############################################################################
# yahoorand
-my $yahoo_random_link = "http://random.yahoo.com/
bin
/ryl";
+my $yahoo_random_link = "http://random.yahoo.com/
fast
/ryl";
# Picks a random page; picks a random image on that page;
# Picks a random page; picks a random image on that page;