Fixed the trains script by changing the parsing strategy; added some responses to shbrain.
This commit is contained in:
parent
24e26c2b66
commit
9c97b6cbe9
2 changed files with 14 additions and 3 deletions
|
@ -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]*)!.*:.*(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]}!
|
||||
|
||||
|
|
13
shtrains.sh
13
shtrains.sh
|
@ -1,18 +1,25 @@
|
|||
#!/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 | \
|
||||
while true
|
||||
do
|
||||
read PATTERN || break
|
||||
while true
|
||||
do
|
||||
read PATTERN || break
|
||||
if [[ $PATTERN =~ \ *[A-Z]{4}\ *(.*)\ *Voie ]]; then
|
||||
PATTERN=${BASH_REMATCH[1]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
read STATION || break
|
||||
read UGUU || break
|
||||
[[ $PATTERN =~ \ *[A-Z]{4}\ *(.*) ]] && PATTERN=${BASH_REMATCH[1]}
|
||||
if [[ $UGUU =~ Supprime ]]; then
|
||||
read UGUU || break
|
||||
continue
|
||||
fi
|
||||
#[[ $STATION =~ Versailles\ Rive\ Droite ]] && STATION="Versailles Rive Droit"
|
||||
if [ -n "$*" ]; then
|
||||
[[ $STATION =~ $@ ]] && echo "$PATTERN $STATION"
|
||||
else
|
||||
|
|
Reference in a new issue