import webbrowser
import urllib
import clipboard


base = 'notesy://x-callback-url/render-markdown?text='
url = clipboard.get()
text = url.encode('utf-8')
text = urllib.quote(text, safe='')
poster = urllib.quote("posterapp://x-callback-url/create?text=", safe='')
actions = '&output-param=text&x-success=' + poster + '&x-error=pythonista://'
webbrowser.open(base + text + actions)
