Evernote Resource Updates for Notes

I use the Evernote API for Python to create an application that allows the user to create and update notes, but I find it difficult to understand how to efficiently update Evernote resources. This happens when I switch from HTML to ENML (Evernote markup language), where I create resources from img tags (now I only look at image resources).

My question is this: how can I say, given HTML, if you need to update note resources? I have considered comparing image data with all current resource data, but it seems very slow. Now I just create a new resource for each img tag.

Some useful resources I've found include the Evernote Resource Guide and this sample code in the Evernote SDK . Any advice is appreciated.

+4
source share
1 answer

A better way would be to compare the hash of the MD5 file. Evernote notes track resources by their MD5 hash file.

To see the hash of the MD5 file attached to the Evernote note, just look at the ENML elements labeled "en-media", the type of tags can be seen below:

 <en-media type="mime-type" hash="md5-of-file" />

mime-type - , md5-of-file - MD5 . ENML Notes getNote ( ) , . ENML - content , getNote ( ).

, MD5 , MD5 , , .

, updateResource :

" . , ( ). , updateNote."

, "" - . , , , . , .

+1

Source: https://habr.com/ru/post/1541985/


All Articles