Archived
1
0
Fork 0

Fixed the trains script by changing the parsing strategy; added some responses to shbrain.

This commit is contained in:
julien 2009-07-24 10:11:49 +02:00
parent 24e26c2b66
commit 9c97b6cbe9
2 changed files with 14 additions and 3 deletions

View file

@ -4,4 +4,8 @@ plop 100 pataplop
:([a-zA-Z]*)!.*:.*(shbot|julien|root).*(fuck|merde) 100 You, fuck you ${BASH_REMATCH[1]}... :([a-zA-Z]*)!.*:.*(shbot|julien|root).*(fuck|merde) 100 You, fuck you ${BASH_REMATCH[1]}...
:([a-zA-Z]*)!.*:.*(clex|galdor).*(fuck|merde|suck) 100 You are right ${BASH_REMATCH[1]}, fuck you ${BASH_REMATCH[2]}. :([a-zA-Z]*)!.*:.*(clex|galdor).*(fuck|merde|suck) 100 You are right ${BASH_REMATCH[1]}, fuck you ${BASH_REMATCH[2]}.
:([a-zA-Z]*)!.*:.*([Tt]a.*gueule|tg).*shbot 100 Fuck you ${BASH_REMATCH[1]}...
:([a-zA-Z]*)!.*:.*(bfb|brainfuck.*bot).*il\ pue 100 Listen to shbot, the one true Bot!
:([a-zA-Z]*)!.*:.*Who\ are\ you\ shbot 100 The One True Bot!
:([a-zA-Z]*)!.*:.*merci\ .*shbot 100 The One True Bot at your service ${BASH_REMATCH[1]}!

View file

@ -1,18 +1,25 @@
#!/bin/bash #!/bin/bash
links -dump 'http://transilien.mobi/pam/TempReelSaisieDepartSubmit.do?debutDepart=Courbevoie&tous=Tous+trains' | head -n 22 | tail -n 18 >trains.tmp links -dump 'http://transilien.mobi/pam/TempReelSaisieDepartSubmit.do?debutDepart=Courbevoie&tous=Tous+trains' >trains.tmp
cat trains.tmp | \ cat trains.tmp | \
while true while true
do do
while true
do
read PATTERN || break read PATTERN || break
if [[ $PATTERN =~ \ *[A-Z]{4}\ *(.*)\ *Voie ]]; then
PATTERN=${BASH_REMATCH[1]}
break
fi
done
read STATION || break read STATION || break
read UGUU || break read UGUU || break
[[ $PATTERN =~ \ *[A-Z]{4}\ *(.*) ]] && PATTERN=${BASH_REMATCH[1]}
if [[ $UGUU =~ Supprime ]]; then if [[ $UGUU =~ Supprime ]]; then
read UGUU || break read UGUU || break
continue continue
fi fi
#[[ $STATION =~ Versailles\ Rive\ Droite ]] && STATION="Versailles Rive Droit"
if [ -n "$*" ]; then if [ -n "$*" ]; then
[[ $STATION =~ $@ ]] && echo "$PATTERN $STATION" [[ $STATION =~ $@ ]] && echo "$PATTERN $STATION"
else else