Last active
August 29, 2015 14:02
-
-
Save tripleee/738b4c41afc4791dd347 to your computer and use it in GitHub Desktop.
Matkahuolto Bookmarklet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title>Matkahuolto Bookmarklet</title></head> | |
<body> | |
<h1>Bookmarklet Test</h1> | |
<p> | |
The unobvious part was that %C5bo in the query parameters had to be escaped as %25C5bo before this would work. | |
Symptoms in Firefox were that the Javascript became visible in the location bar but nothing happened. | |
</p> | |
<code> var d=new Date(); | |
location.href='http://www.matkahuolto.info/lippu/sv/connectionsearch?stat=1' + | |
'&page=criteria&connectionSearchType=departure' + | |
'&selectedDay=' + d.getDate() + | |
'&selectedMonth=' + (d.getMonth()+1) + | |
'&selectedYear=' + d.getFullYear() + | |
'&departureStopAreaName=Helsingfors&arrivalStopAreaName=%25C5bo' + | |
'&allSchedules=0&select=20145&ticketTravelType=0&search=search';</code> | |
<p><a href="javascript:var%20d=new%20Date();location.href='http://www.matkahuolto.info/lippu/sv/connectionsearch?stat=1'+'&page=criteria&connectionSearchType=departure'+'&selectedDay='+d.getDate()+'&selectedMonth='+(d.getMonth()+1)+'&selectedYear='+d.getFullYear()+'&departureStopAreaName=Helsingfors&arrivalStopAreaName=%25C5bo'+'&allSchedules=0&select=20145&ticketTravelType=0&search=search'">Bussar</a></p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To see it in action, the link to use is https://rawgit.com/tripleee/738b4c41afc4791dd347/raw/66b8f4a61aa2a4d5efedf92671acb3123d854c65/bussar.html