Skip to content

Instantly share code, notes, and snippets.

@tommorris
Created July 22, 2015 09:35
Show Gist options
  • Save tommorris/9c8440c89ffed0fc35bc to your computer and use it in GitHub Desktop.
Save tommorris/9c8440c89ffed0fc35bc to your computer and use it in GitHub Desktop.
try:
# Python 3
from urllib.parse import urlparse
except ImportError:
# Python 2.x
from urlparse import urlparse
def evernote_url_to_ios_url(url):
parsed = urlparse(url)
assert parsed.netloc == "www.evernote.com" or parsed.netloc == "sandbox.evernote.com
split_path = parsed.path.split("/")
shard_id = split_path[2]
user_id = split_path[4]
note_guid = split_path[5]
return "evernote:///view/{shard_id}/{user_id}/{note_guid}/".format(
shard_id=shard_id, user_id=user_id, note_guid=note_guid)
@tommorris
Copy link
Author

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