Last active
December 20, 2015 14:58
-
-
Save hardikpandya/6150292 to your computer and use it in GitHub Desktop.
A Pythonista script to load 9292.nl results with 1 click for predefined start and end journey destinations.
This file contains hidden or 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
import datetime #date and time fetching | |
import urllib | |
import webbrowser #for opening links in the in-app browser | |
now= datetime.datetime.now() | |
print datetime.time(now.hour, now.minute) | |
# creating shorthands for larger variable names | |
nh = now.hour | |
nm = now.minute | |
nd = now.day | |
nmonth = now.month | |
############################################### | |
#print now.day | |
#print now.month | |
#print now.year | |
linkq = “http://9292.nl/en/journeyadvice/delft_bushalte-aula-tu/delft_brahmslaan-95/departure/2013-%02d-%02dT%02d%02d?train=off&tram=off” % (nmonth, nd, nh, nm) #creating the URL | |
print linkq #optional to print the created URL | |
webbrowser.open(linkq) #opening URL in the in-app browser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment