Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/bin/bash
set -x
HOST=https://www.ticketswap.nl
FISSA="$1" # Example: /53148/de-beste-singer-songwriter-van-nederland
while :
do
date
URI=$(curl -s "$HOST$FISSA" \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36' \
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'cache-control: max-age=0' \
--compressed |
grep -B 3 offerurl | grep Aangeboden -A 3 | grep offerurl | head -n 1 | awk -F\" '{print $2}')
if [ ! $URI ]; then
sleep 0
continue
fi
say I can make you feel better
URI="$(curl -s "https://www.ticketswap.nl$URI" \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36' \
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'cache-control: max-age=0' \
--compressed |
grep /reserveren/ | head -n 1 | awk -F\" '{print $2}')"
if [ $URI ]; then
open "$HOST$URI"
fi
sleep 1
done

Line 17 suggestion:

say -v "good news" "i can make you feel better"

Why the sleep 1? Why not sleep 0.1?

Owner
pepijn commented Dec 22, 2014

beetje rust voor de servers Koen ;-)

Aycoo commented Mar 6, 2016

hoe gebruik ik zon script?

Owner
pepijn commented Jun 27, 2016

@Aycoo middels captcha's voorkomt Ticketswap inmiddels (sinds ruim anderhalf jaar) dat scripts als deze tickets kunnen reserveren.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment