Skip to content

Instantly share code, notes, and snippets.

@janwirth
Last active September 5, 2015 03:53
Show Gist options
  • Save janwirth/fa07a3a944f5771c0293 to your computer and use it in GitHub Desktop.
Save janwirth/fa07a3a944f5771c0293 to your computer and use it in GitHub Desktop.
Surchkürzel code für DB Suche in Chrome. Verwendung: [Keyword] start to ziel
javascript:
var s='%s';
url='http://reiseauskunft.bahn.de/bin/query.exe/dn?getstop=1&S=%s&Z=%s';
query='';
urlChunks=url.split('%s');
console.log(s);
sChunks=s.split(' to ');
console.log(sChunks);
for(i=0; i<sChunks.length; i++)query+=urlChunks[i]+sChunks[i];
location.replace(query);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment