Mercurial > ~mikael > mcabber > hg
comparison mcabber/contrib/events/eventcmd.pastebin @ 1517:6df03b9b17ba
eventcmd.pastebin: add https and ftp support (suggested by Vic and M. Vuets)
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 27 Sep 2008 21:21:37 +0200 |
parents | 581d7bc8a404 |
children | 4889f429fdd0 |
comparison
equal
deleted
inserted
replaced
1516:581d7bc8a404 | 1517:6df03b9b17ba |
---|---|
35 jid=$3 | 35 jid=$3 |
36 # do nothing if it's from self | 36 # do nothing if it's from self |
37 [ "$jid" == "$me" ] && exit 0 | 37 [ "$jid" == "$me" ] && exit 0 |
38 | 38 |
39 # If receiving a message, scan for links | 39 # If receiving a message, scan for links |
40 url=$(cat "$4" | awk 'BEGIN { RS="( |\n|\t)+"; FS="¬"; } /http:\/\// { print $1 }') | 40 url=$(cat "$4" | awk 'BEGIN { RS="( |\n|\t)+"; FS="¬"; } /(https?|ftp):\/\// { print $1 }') |
41 | 41 |
42 if [ -n "$url" ]; then | 42 if [ -n "$url" ]; then |
43 date=$(/bin/date) | 43 date=$(/bin/date) |
44 | 44 |
45 if [ -n "$me" -a ${#url} -ge $tinyurltrigger ]; then | 45 if [ -n "$me" -a ${#url} -ge $tinyurltrigger ]; then |