Skip to content

Instantly share code, notes, and snippets.

@sven4all
Created June 3, 2019 11:21
Show Gist options
  • Save sven4all/063512859cc1ba6b8a4ffd553c4910db to your computer and use it in GitHub Desktop.
Save sven4all/063512859cc1ba6b8a4ffd553c4910db to your computer and use it in GitHub Desktop.
mkdir -p /tmp/data/chb
cd /tmp/data/chb
echo "Import CHB passengerstopassignment started"
wget "data.ndovloket.nl/haltes/"
PSFILE="$(wget data.ndovloket.nl/haltes/ -O- | grep -o '<a class="link" href=".*">Passenger.*</a>' | sed -r 's/<([^>]*?)>//g')"
if [ -n "$PSFILE" ]; then
wget "data.ndovloket.nl/haltes/${PSFILE}" -O new_passenger_stop_assignment_export.xml.gz
else
echo "No passengerstopassignment file available, therefore file not downloaded and imported."
fi
echo "Import CHB passengerstopassignment completed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment