Skip to content

Instantly share code, notes, and snippets.

#init evernote client
def initEvernote(self):
# Real applications authenticate with Evernote using OAuth, but for the
# purpose of exploring the API, you can get a developer token that allows
# you to access your own Evernote account. To get a developer token, visit
# https://sandbox.evernote.com/api/DeveloperToken.action
if self.authToken == "":
self.authToken = input("Please input your dev token: ")
if self.authToken == "":
from evernote.api.client import EvernoteClient
client = EvernoteClient(token="token", sandbox=False)
def createNewNote():
noteTemplateGuid = "GUID of note to be copied"
notebookGUID = "GUID of notebook to which the note should be copied"
note = client.get_note_store().copyNote(noteTemplateGuid, notebookGUID)
note.title = "New Note Title"
@okxy
okxy / _auth.py
Created April 2, 2014 09:07 — forked from virantha/_auth.py
def _connect_to_evernote(self, dev_token):
user = None
try:
self.client = EvernoteClient(token=dev_token)
self.user_store = self.client.get_user_store()
user = self.user_store.getUser()
except EDAMUserException as e:
err = e.errorCode
print("Error attempting to authenticate to Evernote: %s - %s" % (EDAMErrorCode._VALUES_TO_NAMES[err], e.parameter))
return False
import cgi
import urlparse
tests = [
'http://www.evernote.com/about/kb/search?lang=en&q=test',
'http://www.evernote.com/about/kb/search?q=foo+bar&lang=en',
'http://www.evernote.com/about/kb/search?lang=en',
'I AM A FAKE URL',
'http://www.evernote.com'
]
import sys
import re
from enauath import client
from string import Template
#Accepts the GUID(string) of the note you want to append
def appendNote(guid):
#Get the note to be updated using the note's guid http://dev.evernote.com/documentation/reference/NoteStore.html#Fn_NoteStore_getNote
import clipboard
import sys
import webbrowser
import console
import urllib
print('Parsing URL')
s = (sys.argv[1])
mytext = clipboard.get()
head, sep, tail = mytext.rpartition('/')
#!/usr/bin/python
import cgi, cgitb
# Uncomment this to view errors
# cgitb.enable()
import urlparse
import urllib
import sys
import oauth2 as oauth
#!/usr/bin/env python
# $Id$
import sys
import hashlib
import time
import copy
from string import Template
import thrift.protocol.TBinaryProtocol as TBinaryProtocol
#!/usr/bin/python
#search evernote notes keywords in title
import sqlite3
def main(endbfile, keywords):
conn = sqlite3.connect(endbfile)
cursor = conn.cursor()
sql = """SELECT title, date_created, date_updated, source_url, uid