Simplify the chat/answer example
This commit is contained in:
parent
d73e10e76e
commit
a41e3051a0
|
@ -13,10 +13,6 @@ random() {
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
if (grep -q -- "$1" "ignore"); then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "%s" "$1: "
|
printf "%s" "$1: "
|
||||||
from=$(printf "%s\n" "$1" | tr -d '$`|<>')
|
from=$(printf "%s\n" "$1" | tr -d '$`|<>')
|
||||||
|
|
||||||
|
@ -28,7 +24,6 @@ if [[ ${#string} -gt 750 ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ "$string" == *http*://* ]]; then
|
if [[ "$string" == *http*://* ]]; then
|
||||||
amount=$(sed -e '/https*:\/\//!d' ./frs.txt | wc -l)
|
amount=$(sed -e '/https*:\/\//!d' ./frs.txt | wc -l)
|
||||||
# Makes it a bit more human (time to find a link?).
|
# 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)"
|
cl="$(wget --spider -S "$img" 2>&1)"
|
||||||
if [[ $(printf "%s\n" "$cl" | sed -e '/Content-Type/!d;/image\//!d') ]]; then
|
if [[ $(printf "%s\n" "$cl" | sed -e '/Content-Type/!d;/image\//!d') ]]; then
|
||||||
#echo 'posting'
|
#echo 'posting'
|
||||||
printf "%s\n" "$img $from" >> ../data/pictures
|
printf "%s\n" "$img $from" >> ./pictures.txt
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Exclude last two entries from the amount.
|
# Exclude last two entries from the amount.
|
||||||
|
|
Loading…
Reference in New Issue