Mluvici wap browser (na 54 radku)

Pavel Machek pavel na ucw.cz
Pondělí Prosinec 27 01:39:41 CET 2004


Ahoj!

A dokonce i pouzitelny (na cteni idnes, mobil.cz...), treba se bude
nekomu hodit.... Mel by chodit kdekoliv kde je pristup k internetu,
potrebuje epos a/nebo festival.

								Pavel

#!/bin/bash
#
# Copyright 2004 Pavel Machek <pavel na ucw.cz>
#
# Distribute under GNU GPLv2
#
# Usage: talks [url]
#
# Then type number of link you want to follow and press enter.
#
while true; do

if [ ".$1" == "." ]; then
    	export LANG=cz
#	URL=http://atrey.karlin.mff.cuni.cz/~pavel/index.wml
	URL=http://wap.idnes.cz
else
	URL=$1
fi
killall epos
killall festival
( echo "Loading... " | festival --tts ) &
lynx -dump "$URL" > delme.html
if cat delme.html | grep '<[aA] [hH][rR]' > /dev/null; then
    lynx -dump delme.html > delme2.html
    mv -f delme2.html delme.html
fi

killall festival
cat delme.html | grep -B 1000 References$ | grep -v References$ | sed 's/\[\([0-9]*\)\]/link \1 /g' > delme_page.txt
cat delme.html | grep -A 1000 References$ | grep -v References$ > delme_references.txt

cat delme_page.txt

if [ .$LANG == .cz ]; then
    epos
    sleep 0.1
    say `cat delme_page.txt` &
else
    cat delme_page.txt | festival --tts &
fi

echo Your choice?
read A
if [ .$A == .en ]; then
    echo Okay, english
    LANG=en
    read A
fi
if [ .$A == .cz ]; then
    echo Okay, czech
    LANG=cz
    read A
fi
if [ .$A == .r ]; then
    echo Okay, reloading
    continue
fi
if [ .$A == .b ]; then
    exit
fi

NEWURL=`cat delme_references.txt | grep "^[ ]*$A\." | sed 's/^[^.]*\. //g'`
talks $NEWURL

done


-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!


Další informace o konferenci Linux