[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[palm-unix-j:00125] Re: Palm(&UNIX)で使えるアプリケーション



お久しぶりです、川島です。

> Palmに付属するWindows上の母艦ソフト?でできることは
> 大抵できると思います。上記のWeb巡回ソフトにしても、UNIX上で動作する
> その手のものはあるわけですから、ちょっとパワーのある人なら、
> それをPalmのデータに自動編集するぐらいは、自力でやっちゃうと
> 思いますよ。
そうですね。
テキストベースの web ブラウザには w3m という日本発の強力な味方や、
lynx などが存在するので、これをベースにして巡回なんか簡単にできてしまいます。
この ML にも以前秀逸なスクリプトが流れてましたね。
ごそごそ。ありました。
中島さんの作です。(中島さん無断で再掲してごめんなさい。私の作った
ものよりはるかに良いので)

shar してあります。

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2000-07-14 10:16 JST by <kei@gaia>.
# Source directory was `/opt/share/home/kei'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   2175 -rwxr-xr-x /tmp/web2palm
#
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  echo 'WARNING: not restoring timestamps.  Consider getting and'
  echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
# ============= /tmp/web2palm ==============
if test ! -d '/tmp'; then
  echo 'x - creating directory /tmp'
  mkdir '/tmp'
fi
if test -f '/tmp/web2palm' && test X"$1" != X"-c"; then
  echo 'x - skipping /tmp/web2palm (file already exists)'
else
  echo 'x - extracting /tmp/web2palm (text)'
  sed 's/^X//' << 'SHAR_EOF' > '/tmp/web2palm' &&
#!/bin/sh
########################################################################
#
#   Web2palm, Web Retrieve and Install Scripts for Palm
#
#                                   Copyright (c) 1999 Motomu Nakashima
#
########################################################################
X
# Location of files...
#LIBDIR=.
LIBDIR=~/.web2palm
X
# HTML retrieve command
#WGET='wget -O'
WGET='lynx -source'
X
# URLs (as you like...)
URLS='
http://www.palmfan.com/udr.html
http://palm.org/
http://home.att.ne.jp/red/tetsujih/pilot/pilot.html
http://muchy.com/
'
X
# Initializing...
rm -f  $LIBDIR/palminstall*
rm -rf $LIBDIR/HTML
rm -rf $LIBDIR/Text
rm -rf $LIBDIR/Doc
mkdir $LIBDIR/HTML
mkdir $LIBDIR/Text
mkdir $LIBDIR/Doc
echo "#!/bin/sh" >> $LIBDIR/palminstall.euc
X
# Retrieving HTML files and converting to test files...
num=1
for URL in $URLS
do
X    # Retrieving HTML file
X    $WGET $URL >$LIBDIR/HTML/$num.html
X
X    # Converting to text file
X    nkf -e $LIBDIR/HTML/$num.html > $LIBDIR/web2palm_tmp.html
X    tr -d '\n' < $LIBDIR/web2palm_tmp.html  > $LIBDIR/web2palm_tmp2.html
X    tr -d '\r' < $LIBDIR/web2palm_tmp2.html > $LIBDIR/web2palm_tmp.html
X    tr -d '\f' < $LIBDIR/web2palm_tmp.html  > $LIBDIR/web2palm_tmp2.html
X    sed -f $LIBDIR/web2palm_sed_cmd1 $LIBDIR/web2palm_tmp2.html > \
X                                    $LIBDIR/web2palm_tmp.txt
X    sed -f $LIBDIR/web2palm_sed_cmd2 $LIBDIR/web2palm_tmp.txt > \
X                                    $LIBDIR/web2palm_tmp2.txt
X    uniq < $LIBDIR/web2palm_tmp2.txt > $LIBDIR/Text/$num.txt
X    rm -f $LIBDIR/web2palm_tmp*.*
X
X    # Getting title part 
X    TITLE=`sed -f $LIBDIR/web2palm_sed_cmd3 $LIBDIR/Text/$num.txt | 
X           head -n 1`
X    nkf -s $LIBDIR/Text/$num.txt > $LIBDIR/Text/$num.sjis
X
X    # Writting to installing scripts
X    echo "makedoc $LIBDIR/Text/$num.sjis $LIBDIR/Doc/$num.prc $TITLE" \
X                     >> $LIBDIR/palminstall.euc
X
X    num=`expr $num + 1`
done
X
# Post processing...
echo "pilot-xfer -i $LIBDIR/Doc/*.prc" >> $LIBDIR/palminstall.euc
nkf -s $LIBDIR/palminstall.euc > $LIBDIR/palminstall.sjis
X
# Installing to Palm (convert to DOC files and pilot-xfer)
sh $LIBDIR/palminstall.sjis 
X
SHAR_EOF
  $shar_touch -am 07141014100 '/tmp/web2palm' &&
  chmod 0755 '/tmp/web2palm' ||
  echo 'restore of /tmp/web2palm failed'
  shar_count="`wc -c < '/tmp/web2palm'`"
  test 2175 -eq "$shar_count" ||
    echo "/tmp/web2palm: original size 2175, current size $shar_count"
fi
exit 0
----
Kawashima