Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Untitled 1

View Untitled 1.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#coding: utf-8
# Original script by Federico Viticci:
# http://www.macstories.net/reviews/fantastical-for-iphone-review/
# Modified to work better with international characters
 
import webbrowser
import clipboard
import urllib
import console
 
when = clipboard.get()
 
fant = 'fantastical://parse?sentence='
 
newtask = console.input_alert('What is this?', 'Type your event below')
 
loc = console.alert('Location', 'Does the event have a location?', 'Yes', 'No')
 
if loc == 1:
place = console.input_alert('Where', 'Type your location below')
 
event = newtask.decode('utf-8') + ' ' + when + ' at ' + place.decode('utf-8')
 
encoded = urllib.quote(event.encode('utf-8'), safe='')
elif loc == 2:
event = newtask.decode('utf-8') + ' ' + when
print type(event)
encoded = urllib.quote(event.encode('utf-8'), safe='')
text = fant + encoded
 
webbrowser.open(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.