Skip to content

Instantly share code, notes, and snippets.

@hoodie
Created June 8, 2013 15:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoodie/5735508 to your computer and use it in GitHub Desktop.
Save hoodie/5735508 to your computer and use it in GitHub Desktop.
calls the vvo api
#!/bin/bash
station=${@:-Slub}
exec 6<> /dev/tcp/widgets.vvo-online.de/80
printf "GET /abfahrtsmonitor/Abfahrten.do?ort=Dresden&hst=$station&vz=0 HTTP/1.0
Host: widgets.vvo-online.de
User-Agent: Ach ja, die 61
Connection: close\n\n" >&6
#cat <&6 | grep '\[\[' | sed -e 's/\],\[/\n/g' -e 's/\[\[\|\]\]//g' -e 's/\",\"/ /g' -e 's/\"//g'
cat <&6 | grep '\[\[' | sed 's/\[*"\([^"]*\)","\([^"]*\)","\([^"]*\)"\]*,\?/\3\t\1\t\2\n/g'
exec 6>&-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment