Concatenate String to Evernote Markup Language (ENML) in python

Posted by Adam the Mediocre on Stack Overflow See other posts from Stack Overflow or by Adam the Mediocre
Published on 2014-06-10T21:21:57Z Indexed on 2014/06/10 21:24 UTC
Read the original article Hit count: 233

Filed under:
|
|

I am looking to add a string containing the user's text input to the note.content of my note. After reading, I have found how to add resources, but I don't want the resource to be an attachment, I want it to be the actual text.

Here is some of the code:

    title= self.textEditTitle.text()
    body= self.textEditBody.text()        

    auth_token = "secret stuff!"

    client = EvernoteClient(token=auth_token, sandbox=True)

    note_store = client.get_note_store()

    nBody = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    nBody += "<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">"
    nBody += "<en-note>%s</en-note>" % body

    note = Types.Note()
    note.title = title
    note.content= nBody

Any advice would be great, as I'm just starting out with this api and it looks like it's full of potential once I figure it out! Here is what I have been mostly reading from: http://dev.evernote.com/documentation/cloud/chapters/ENML.php

© Stack Overflow or respective owner

Related posts about python

Related posts about Xml