From 63a00c757d1202c71b44709eebe48560bf686b2c Mon Sep 17 00:00:00 2001 From: Robert Lowe Date: Mon, 7 Mar 2011 23:16:18 -0500 Subject: [PATCH] * 2 new functions, wmate & raw * wmate will pipe wget into textmate and tidy for you (command + z to undo tidy) * raw will pipe wget into your browser --- plugins/browser.plugin.bash | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/plugins/browser.plugin.bash b/plugins/browser.plugin.bash index 6de184c..fdfba4f 100644 --- a/plugins/browser.plugin.bash +++ b/plugins/browser.plugin.bash @@ -27,3 +27,71 @@ usage open $f fi } + + +# pipe hot spicy interwebs into textmate and cleanup! +# +# Usage: wmate +# wget into a pipe into TextMate and force Tidy (you can undo in textmate) +# e.g. +# $ wmate google.com + +function wmate() { + if [ -t 0 ]; then + if [ -n "$1" ]; then + wget -qO- $1 | /usr/bin/mate + +TIDY=`/usr/bin/osascript << EOT +tell application "TextMate" + activate +end tell + +tell application "System Events" + tell process "TextMate" + tell menu bar 1 + tell menu bar item "Bundles" + tell menu "Bundles" + tell menu item "HTML" + tell menu "HTML" + click menu item "Tidy" + end tell + end tell + end tell + end tell + end tell + end tell +end tell +EOT` + + else + cat <