!/bin/bash
Web slurping script
for srcurl in "$@"
do
Title content extraction
title=`echo $srcurl | wget -i - -q -O - | nkf --utf8 | grep "<title>.*</title>\|<TITLE>.*</TITLE>" | sed -e "s/\(.*<title>\|.*<TITLE>\)\(.*\)\(<\/title>.*\|<\/TITLE>.*\)/\2/g"`
Headline generation
headline=`echo "[$title]($srcurl)"`
Body content extraction
body=`w3m $srcurl`
Output
echo "*"$'\t'"$headline"$'\n'$'\n'$'\n'"$body"$'\n'$'\n'
done
よーしこれで記事収集の手間が減らせる。
