Git Product home page Git Product logo

Comments (7)

Laurent-Sarrazin avatar Laurent-Sarrazin commented on May 28, 2024

Hi Timm,

What do you mean by "empty" ? No content ? Null ?
Are you sure the note has not been deleted ?
Is it a business note ? A note in an app notebook ? (It should work in these cases too but I'm trying to find what could be the cause of the issue).

Thanks !

from evernote-cloud-sdk-php.

t1mmen avatar t1mmen commented on May 28, 2024

Empty sting (''), note is not deleted, personal account, note is created from Evernote web app in default notebook. I got the note id from a webhook event.

I can post note id when I am home again, if that helps. Thanks for looking into this for me!

Den 24. feb. 2015 kl. 17.34 skrev Laurent Sarrazin [email protected]:

Hi Timm,

What do you mean by "empty" ? No content ? Null ?
Are you sure the note has not been deleted ?
Is it a business note ? A note in an app notebook ? (It should work in these cases too but I'm trying to find what could be the cause of the issue).

Thanks !


Reply to this email directly or view it on GitHub.

from evernote-cloud-sdk-php.

Laurent-Sarrazin avatar Laurent-Sarrazin commented on May 28, 2024

hmm, well I guess I'll have to setup a webhook to check that as the getNote() works fine with a 'static' note guid...

from evernote-cloud-sdk-php.

t1mmen avatar t1mmen commented on May 28, 2024

Hold on, something weird is going on. I am using CakePHP on my end, and checking return values using debug(), which works well with strings, arrays and objects... except the return from Client::getNote, which just comes out as empty.

A var_dump or print_r, on the other hand, does return the Evernote\Model\Note object. Perhaps this is related to the format of the content key?

// from above..
$client = new \Evernote\Client($token, false); // token is valid, app is in production mode
$note = $client->getNote($message['guid']);

print_r($note->content);

// outputs....
Evernote\Model\EnmlNoteContent Object
(
    [htmlConverter:protected] => 
    [content:protected] => <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note>
<div>Let’s see what the webhook says….</div>
</en-note>

    [enmlConverter:protected] => 
)

Sorry about the misunderstanding. Perhaps this content formatting could be straight up HTML or Markdown? How would you recommend I parse this into HTML?

from evernote-cloud-sdk-php.

Laurent-Sarrazin avatar Laurent-Sarrazin commented on May 28, 2024

Pretty weird that the debug() method returns an empty string...
Anyway, you can try to use the toHtml() method on the content :

$htmlContent = $note->content->toHtml();

This is mostly an "experimental" feature for now so let me know how it works for you.

from evernote-cloud-sdk-php.

t1mmen avatar t1mmen commented on May 28, 2024

Thanks, Laurent. Unfortunately, the toHtml didn't produce the desired result for me. It outputs:

'<html><body>
<div>Let’s see what the webhook says!</div>
<div><br></div>
</body></html>

.. but the encoding problem persists. Based on this thread on Stackoverflow, I managed to convert the encoding to UTF-8, making it usable for me.

Thank you for the assistance!

One last thing before closing this issue: Am I correct in assuming I need to do a seperate getNotebook call to get the name of the notebook? I'm not seeing it anywhere in the Evernote\Model\Note debug output.

from evernote-cloud-sdk-php.

Laurent-Sarrazin avatar Laurent-Sarrazin commented on May 28, 2024

Yep the conversion is pretty basic right now.
As for the notebook, yes you have to make another call. The notebook name is not included in the note.

from evernote-cloud-sdk-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.