diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-05-26 21:41:57 +0200 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-05-26 21:41:57 +0200 |
commit | 10c5302f00d3339bd45a47b23075e9ea64a8d0ab (patch) | |
tree | 31699808f16a041e1e71994666ce932eb6be9662 | |
parent | be8641ae76fa0d2abb2c6775b7a412e92a39c328 (diff) |
uzblcat script by mxf
-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 |