That’s perfect! Thanks for pointing that out. I believe I have found the draft mechanism under jsapp/models/draft.js.es6. Looks like there are a get and a get_local method - both require a key. My question now is should I call that method every 2 seconds or is there an event broadcaster that I can listen to? I guess that would probably require WebSockets.
I’ll download and install the akismet plugin today and have a look around and see how they get comments from the composer and process it.
[edit]
I need to:
- Determine when the user has started a new composition or opened a saved draft
- poll their draft every 2 seconds
- analyze the draft with PAPI
- use JIT notifications to warn the user about toxicity
- determine when the user has deleted their draft or published it so that the plugin can stop polling the composer.