Following is an introduction to the Devernote (Drupal Evernote) module and how to use it. The module is available on github at: https://github.com/akempler/devernote
A lot of journalists and bloggers I work with use Evernote, myself included. My current workflow has been to write posts in Evernote and copy and paste them into Drupal.
I wanted an easy way to import specific notes. After a bit of googling I found two potential modules:
The Evernote module:https://www.drupal.org/project/evernote. Unfortunately this never got past a beta 6.x version.
There was also the Feeds Evernote module:https://www.drupal.org/project/feeds_evernote. This never got past a dev version, last updated in 2013.
Even though this was initially for myself, I wanted it to be multi-user since many of the tools I build are for newsrooms. It needed to allow each user to work with their own accounts and notebooks. Thus was born the Devernote module (Drupal Evernote). This module makes it super easy to tag notes for import in Evernote and bring them into Drupal, including any images that were embedded.
Using the Devernote module
Evernote API Key:
First you'll need to get an Evernote API key to use the module on your site. You need this to allow the module to read your Evernote notes. Go to:https://dev.evernote.com/doc/ and click "GET AN API KEY". This is a two step process. Once you get your api key, you will need to request that it be made available for production use. Initially, the keys are just for use on their sandbox site.
The Devernote module uses some third party libraries such as the Evernote SDK and Guzzle. These are installed and managed via Composer. Labeled as a dependency management tool for PHP, you can think of Composer as a much improved version of the Pear package library. It gives you access to a wide variety of libraries and tools to include in your Drupal modules.
You can install Composer locally per project or globally. I prefer globally: CD into your home directory and run:
curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer
This will download the composer.phar file to your home directory and then move it to your bin to make it globally accessible. Now you can just run the command:
For more information on Composer see:https://getcomposer.org/doc/00-intro.md
Composer Manager Module:
One of the best ways I've found to use Composer in Drupal 7 is with Composer Manager: https://www.drupal.org/project/composer_manager
This module will combine all the composer.json files from any modules using Composer into a single file in your files directory. You would then run composer install from you sites/default/files/composer (or whatever path your files directory is). See the module page for more information.
Encrypting the oauth token:
When you import Evernote notes via the module, you will first be redirected to Evernote to authenticate and authorize the connection. An oauth token will be returned, saved to the database and used for subsequent connections. If either the aes or encrypt Drupal modules are installed, the token will be stored encrypted. This is recommended but not required. I use the aes module but if you already have the encrypt module enabled you can use that instead.
Install the Devernote module:
The Composer Manager module recommends enabling modules containing composer.json files using drush:
drush en devernote
This will automatically generate the consolidated composer.json file and run the appropriate Composer commands. You can also manually enable them by cd'ing to the composer directory containing the composer.json file. For example: /sites/default/files/composer/composer.json. You can check what it is set to by going to: /admin/config/system/composer-manager/settings. By default it is public://composer. Once in that directory you can run composer install --no-dev. Change install to update to update the dependencies. See this page for more info on Composer Manager: https://www.drupal.org/node/2405805
Configure the module at: /admin/config/content/devernote
Here you can specify some defaults for importing notes including the ability to specify a image style to automatically apply to imported images. You'll also need to enter the Consumer Key and Secret Key you received when registering for an Evernote API Key.
To import notes, tag them with "drupalimport" in Evernote (you can also use your own custom tag and specify it during the import process). Then go to the import form at /devernote_import and click "import". Any notes with that tag will be imported. You can specify what content type to create during the import process.
Once a note is imported, it will be ignored during future imports. To re-import a note, Delete the node that was created. It will then be imported the next time you run the import.
The Evernote PHP SDK requires the XSLTProcessor Class so you'll need the php xsl extension installed and enabled if it isn't already. On Ubuntu:
sudo apt-get install php5-xsl
The aes module requires the mcrypt extension. For Ubuntu:
sudo apt-get install php5-mcrypt sudo php5enmod mcrypt sudo service php5-fpm restart sudo service nginx restart
NOTE: the multi-user functionality still needs to be implemented.