url_handler() { lastdate=${1} lastnick=${2} lastline=${3} line=$(echo ${lastline} | grep -m 1 -i -E "https?://") if [ ! -z "$line" ]; then url=$(echo "$line"| grep -o -i -E "https?://.*" | cut -d" " -f1) # is this old wanha=$(head --lines=-1 ${outfile} | grep -m1 "${url}") if [ -n "${wanha}" ]; then /home/users/petteri/bin/fecho "wanha: ${wanha}" $infile return fi title=$(echo "$url" | /home/users/petteri/bin/gettitle.py) title2=${title} if [ "${url}" == "${title2}" ]; then title2="otsikkoa ei löytynyt" fi /home/users/petteri/bin/fecho "$title2" $infile # update the 23 front page title=$(echo ${title} | tr -d \") /home/users/petteri/ohjelmointi/linkit2/deploy "${lastdate}" "${url}" "${title}" "${lastnick}" fi }