[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[palm-unix-j:00031] Re: lynx instead of PILOWEB
- Subject: [palm-unix-j:00031] Re: lynx instead of PILOWEB
- From: Hiroshi Kawashima <kei@arch.sony.co.jp>
- Date: Sat, 09 Oct 1999 13:01:21 +0900
- Delivered-To: knok@daionet.gr.jp
- In-reply-to: Your message of Sat, 09 Oct 1999 11:05:33 +0900. <19991009110533U.keizo.suzuki@nifty.ne.jp>
こんにちは、川島です。
> UNIX環境ではlynxを使うと同様の環境ができると思うのですが,
> lynx -dump では80桁を想定して出力されてしまうので,Palm上でみると
> 不自然な形になってしまいます.
あまり参考になるかどうかわかりませんが、以前 Unix 版の piloasa
(朝日新聞 www.asahi.com を DOC 形式に変換する)もどきを作成したこと
がありますので、お目汚しかもしれませんが、お送りさせていただきます。
lynx -source で取り出した後に、jfold などでトリミングしてやれば
比較的自由に行幅の調整が可能ではないかな、と思います。
==== cut here ======== cut here ======== cut here ======== cut here ====
#! /bin/csh -f
onintr cleanup
##################################
# Change this for your environment
set exportdir = "$HOME/AsahiNews"
##################################
set date = `date +'%m%d%H%M'`
set tmp = "/tmp/.piloasa.$$"
set outbase = "Asahi-$date"
set out = "$exportdir/$outbase.pdb"
set txt = "$exportdir/$outbase.txt"
# '<< PalmFan >>' \
# "http://www.palmfan.com/udr.html#top" \
set urls = ( \
'<<今日の朝刊>>' \
"http://www.asahi.com/paper/front.html" \
'<<社会面>>' \
"http://www.asahi.com/flash/fnational.html" \
'<<政治面>>' \
"http://www.asahi.com/flash/fpolitics.html" \
'<<経済面>>' \
"http://www.asahi.com/flash/fbusiness.html" \
'<<国際面>>' \
"http://www.asahi.com/flash/finternational.html" \
'<<スポーツ面>>' \
"http://www.asahi.com/flash/fsports.html" \
'<<天気予報>>' \
"http://www.asahi.com/weather/weather.html" \
)
# Get contents && split HTML tags.
cp /dev/null $txt
while ($#urls > 0)
set theme = "$urls[1]"
shift urls
set u = "$urls[1]"
echo "Retrieving $u..."
echo "$theme" | nkf -e >>$txt
lynx -source $u | tr '\r' '\n' | nkf -e | sed 's/<[^>]*>//g' | uniq >>$txt
shift urls
end
# Conver to Shift-JIS
nkf -s $txt >$tmp
# Generate Doc file
makedoc $tmp $out "$outbase"
chmod 666 $out
echo ""
ls -l $out
pilot-xfer /dev/pilot -i $out
cleanup:
rm -f $out $tmp
# 今日の朝刊
# http://www.asahi.com/paper/front.html
# 社会
# http://www.asahi.com/flash/fnational.html
# 政治
# http://www.asahi.com/flash/fpolitics.html
# 経済
# http://www.asahi.com/flash/fbusiness.html
# 国際
# http://www.asahi.com/flash/finternational.html
# スポーツ
# http://www.asahi.com/flash/fsports.html
# 天気予報
# http://www.asahi.com/weather/weather.html
==== cut here ======== cut here ======== cut here ======== cut here ====