Skip to content

Instantly share code, notes, and snippets.

View evernotegists's full-sized avatar

Evernote Gists evernotegists

  • Evernote Corporation
  • Redwood City, CA
View GitHub Profile
https://www.evernote.com/shard/s12/sh/4d971333-8b65-45d6-857b-243c850cabf5/25771cdb535e9183
<a href="evernote:///view/76136038/s12/4d971333-8b65-45d6-857b-243c850cabf5/4d971333-8b65-45d6-857b-243c850cabf5/2cd4dc67-1d52-401f-9aad-d5524b646ba2">Travel plans</a>
evernote:///view/76136038/s12/4d971333-8b65-45d6-857b-243c850cabf5/4d971333-8b65-45d6-857b-243c850cabf5/2cd4dc67-1d52-401f-9aad-d5524b646ba2
https://www.evernote.com/shard/s12/nl/76136038/d72dfad0-7d58-41b5-b2c9-4ca434abd543/
@evernotegists
evernotegists / gist:793b9c5cf61276e21b68
Created December 9, 2014 18:35
Convert a resource hash to a byte array for noteStore.getResourceByHash
/// To be used alongside our Cloud SDK: https://github.com/evernote/evernote-cloud-sdk-ios
/// "hashCode" below is the "hash=" value extracted from the en-media tag
byte[] bytes = ConvertStringToByteArray(hashCode);
Resource resrc = enNoteStore.getResourceByHash(authToken, noteGuid, bytes, true, false, false);
string resourceContent = Convert.ToBase64String(resrc.Data.Body);
/// The function convertStringToByteArray is:
private byte[] ConvertStringToByteArray(string stringToConvert)
{
@evernotegists
evernotegists / thumbnail-post-request.py
Last active October 30, 2023 09:50
Thumbnail post request in Python
import requests
ACCESS_TOKEN="INSERT YOUR AUTH TOKEN OR DEV TOKEN HERE"
payload={'auth':ACCESS_TOKEN} #map auth token to param "auth"
r=requests.post('https://www.evernote.com//shard/s1/thm/note/e679c090-d8b2-4644-9eag-56bd31c84bf7.jpg?size=75',data=payload, stream=True) #returns a binary of the picture type in header
f=open('thumbnail.jpg','wb') #open file for binary writing
f.write(r.content) #write binary contents of request to a file
f.close() #close the file
value = note_store.getNoteApplicationDataEntry(note.guid, dkey)
note = Types.Note()
note.title = "I will soon have application data"
note.content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
note.content += "<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">"
note.content += "<en-note>Content goes here</en-note>"
note = note_store.createNote(note)
# Now we have the note GUID and can add applicationData
// Create Notebook
[base URL]/?userId=[user ID]&notebookGuid=[notebook GUID]&reason=notebook_create
// Update Notebook
[base URL]/?userId=[user ID]&notebookGuid=[notebook GUID]&reason=notebook_update
// Create Note
[base URL]/?userId=[user ID]&guid=[note GUID]&notebookGuid=[notebook GUID]&reason=create
// Update Note
@evernotegists
evernotegists / b64dec.py
Created August 1, 2013 19:41
Convert base64-encoded data from an exported Evernote note back to its original form.
#!/usr/bin/env python
# Copyright 2013 Evernote Corporation. All rights reserved.
import base64
import sys
# Copy the base64 string from the ENEX file and put it into a file
# Pipe base64-encoded data to STDIN