Skip to content

Instantly share code, notes, and snippets.

@evernotegists
Last active October 30, 2023 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evernotegists/73179425cbfc60e3de98 to your computer and use it in GitHub Desktop.
Save evernotegists/73179425cbfc60e3de98 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment