From 09827f9ab91bfdb7740142de4aa6f94f2b4b4e3b Mon Sep 17 00:00:00 2001 From: Kai Hendry Date: Sun, 15 Jan 2012 14:32:19 +0800 Subject: [PATCH] hide verbose messages and print OVER CAPACITY clearly fixes #2 --- fetch-tweets.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch-tweets.sh b/fetch-tweets.sh index b9b4311..51bc88e 100755 --- a/fetch-tweets.sh +++ b/fetch-tweets.sh @@ -61,9 +61,9 @@ grep -iE 'rate|status' # show the interesting twitter rate limits mv $temp2 $temp -if test $(xmlstarlet sel -t -v "count(//statuses/status)" $temp) -eq 0 +if test $(xmlstarlet sel -t -v "count(//statuses/status)" $temp 2>/dev/null) -eq 0 then - head $temp | perl -MHTML::Entities -pe 'encode_entities($_)' + head $temp | grep -q "Over capacity" && echo "Twitter is OVER CAPACITY" if test "$2" && test "$since" then echo No old tweets ${since}