From 8ec5e93d309f6a25789881db3f414d16dd017cd9 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 16 Jun 2009 12:31:41 +0200 Subject: be able to work on bare HTML source --- config.sample | 1 + w3watch | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config.sample b/config.sample index a6b631a..d6e8f5a 100644 --- a/config.sample +++ b/config.sample @@ -4,6 +4,7 @@ # * Every line contains one URL # * An optional filter can be defined by separating any command # from the url using whitspaces +# * Prepend an @ to the URL to work on bare HTML source # # Example: # diff --git a/w3watch b/w3watch index ba8f975..6abc305 100755 --- a/w3watch +++ b/w3watch @@ -63,7 +63,13 @@ while read line; do url="${data[0]}" filter="${data[@]:1}" - dump=$(lynx -dump "$url") + if echo "$url}" | grep -q '^@'; then + url="$(echo "${url}" | cut -c 1 --complement -)" + dump=$(lynx -source "$url") + else + dump=$(lynx -dump "$url") + fi + if [ $? -ne 0 ]; then rm -f "${LOCKFILE}" exit 1 -- cgit v1.2.3-24-g4f1b