Skip to content

Instantly share code, notes, and snippets.

@tripleee
Last active August 29, 2015 14:02
Show Gist options
  • Save tripleee/738b4c41afc4791dd347 to your computer and use it in GitHub Desktop.
Save tripleee/738b4c41afc4791dd347 to your computer and use it in GitHub Desktop.
Matkahuolto Bookmarklet
<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' +
'&amp;page=criteria&amp;connectionSearchType=departure' +
'&amp;selectedDay=' + d.getDate() +
'&amp;selectedMonth=' + (d.getMonth()+1) +
'&amp;selectedYear=' + d.getFullYear() +
'&amp;departureStopAreaName=Helsingfors&amp;arrivalStopAreaName=%25C5bo' +
'&amp;allSchedules=0&amp;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'+'&amp;page=criteria&amp;connectionSearchType=departure'+'&amp;selectedDay='+d.getDate()+'&amp;selectedMonth='+(d.getMonth()+1)+'&amp;selectedYear='+d.getFullYear()+'&amp;departureStopAreaName=Helsingfors&amp;arrivalStopAreaName=%25C5bo'+'&amp;allSchedules=0&amp;select=20145&ticketTravelType=0&search=search'">Bussar</a></p>
</body>
</html>
@tripleee
Copy link
Author

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