Add HTML title support. - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit c6558cda8f3ef0c966a924dd8c98cd24a68f69f2
(DIR) parent 8ef63faa063c71c42142e1bf2892e8ccafacbb6c
(HTM) Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Mon, 2 Apr 2018 11:05:58 +0200
Add HTML title support.
Diffstat:
M annna-start-services | 12 ++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/annna-start-services b/annna-start-services
@@ -86,6 +86,18 @@ then
[ $ismember -lt 1 ] && continue
[ "$user" = "${botname}" ] && continue
+ uri="$(printf "%s\n" "${text}" \
+ | sed 's,.*\(http[s]\?://[^ ]*\).*,\1,' \
+ | grep -e 'http\(s\|\)://')"
+ if [ -n "$uri" ];
+ then
+ urititle="$(curl-grabtitle "${uri}")"
+ if [ -n "$urititle" ];
+ then
+ annna-say -c "#bitreich-en" "HTML title: ${urititle}"
+ fi
+ continue
+ fi
if [ "${text}" = "${botname}, be cool." ];
then