diff options
-rw-r--r-- | AUTHORS | 1 | ||||
-rwxr-xr-x | examples/scripts/uzblcat | 20 |
2 files changed, 21 insertions, 0 deletions
@@ -16,6 +16,7 @@ Contributors: Peter Suschlik - backwards searching (salinasv) - move some variables to heap Sylvester Johansson (scj) - original form filler script + (mxf) - uzblcat Originaly based on http://trac.webkit.org/browser/trunk/WebKitTools/GtkLauncher/main.c Which is copyrighted: diff --git a/examples/scripts/uzblcat b/examples/scripts/uzblcat new file mode 100755 index 0000000..82341c7 --- /dev/null +++ b/examples/scripts/uzblcat @@ -0,0 +1,20 @@ +#!/usr/bin/env perl +# uzblcat - safely push html to uzbl +# See http://www.uzbl.org/wiki/html-mode +use strict; use warnings; + +my $html; +local $/; # slurp files +# automagically choose to read from stdin/files/... +$html .= $_ for <>; + +my $endmarker = rand; +$endmarker .= rand() while $html =~ /^\Q$endmarker\E$/m; + +print "set base_url = $ENV{BASE_URL}\n" if $ENV{BASE_URL}; +print << "EOS"; +set html_endmarker = $endmarker +set mode = 1 +$html +$endmarker +EOS |