From a41e3051a09579112ba1a199f4ad5c31c53fd206 Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Thu, 8 Sep 2016 23:00:13 +0300 Subject: [PATCH] Simplify the chat/answer example --- examples/chat/answer | 7 +------ examples/chat/pictures.txt | 0 2 files changed, 1 insertion(+), 6 deletions(-) create mode 100644 examples/chat/pictures.txt diff --git a/examples/chat/answer b/examples/chat/answer index 36cc1b7..c28a0f0 100755 --- a/examples/chat/answer +++ b/examples/chat/answer @@ -13,10 +13,6 @@ random() { cd "$(dirname "$0")" -if (grep -q -- "$1" "ignore"); then - exit 0 -fi - printf "%s" "$1: " from=$(printf "%s\n" "$1" | tr -d '$`|<>') @@ -28,7 +24,6 @@ if [[ ${#string} -gt 750 ]]; then exit 0 fi - if [[ "$string" == *http*://* ]]; then amount=$(sed -e '/https*:\/\//!d' ./frs.txt | wc -l) # Makes it a bit more human (time to find a link?). @@ -39,7 +34,7 @@ if [[ "$string" == *http*://* ]]; then cl="$(wget --spider -S "$img" 2>&1)" if [[ $(printf "%s\n" "$cl" | sed -e '/Content-Type/!d;/image\//!d') ]]; then #echo 'posting' - printf "%s\n" "$img $from" >> ../data/pictures + printf "%s\n" "$img $from" >> ./pictures.txt fi else # Exclude last two entries from the amount. diff --git a/examples/chat/pictures.txt b/examples/chat/pictures.txt new file mode 100644 index 0000000..e69de29