Created
November 30, 2012 17:34
-
-
Save omz/4177224 to your computer and use it in GitHub Desktop.
Untitled 1
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
#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