aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Robert Manea <gotmor@gmail.com>2009-08-07 23:11:54 +0200
committerGravatar Robert Manea <gotmor@gmail.com>2009-08-07 23:11:54 +0200
commit6217ae8a928e9b5ce75ed29e765e403678a2ce61 (patch)
treedf7bb04b0ef701cea2c02e853511e34aac9ea92c /examples
parent8d5d1e21c1dfef6ad2f26bf31b2cbc28e88c82de (diff)
removed html_mode in favour of "data URI scheme"
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/data/uzbl/scripts/uzblcat22
1 files changed, 7 insertions, 15 deletions
diff --git a/examples/data/uzbl/scripts/uzblcat b/examples/data/uzbl/scripts/uzblcat
index 5c3063e..e955608 100755
--- a/examples/data/uzbl/scripts/uzblcat
+++ b/examples/data/uzbl/scripts/uzblcat
@@ -1,20 +1,12 @@
-#!/usr/bin/env perl
+#!/usr/bin/env python
# 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 <>;
+from sys import stdin, stdout
-my $endmarker = rand;
-$endmarker .= rand() while $html =~ /^\Q$endmarker\E$/m;
+stdout.write("uri data:text/html,")
+for line in stdin:
+ stdout.write(line[0:-1])
+
+# vim: set noet ff=unix
-print "set base_url = $ENV{BASE_URL}\n" if $ENV{BASE_URL};
-print << "EOS";
-set html_endmarker = $endmarker
-set mode = 1
-$html
-$endmarker
-EOS