NAME

Net::Evernote - Perl API for Evernote

VERSION

Version 0.06

SYNOPSIS

use Net::Evernote;

my $evernote = Net::Evernote->new({
    authentication_token => $authentication_token
});

# write a note
my $res = $evernote->createNote({
    title => $title,
    content => $content
});

my $guid = $res->guid;

# get the note
my $thisNote = $evernote->getNote({ guid => $guid });
print $thisNote->title,"\n";
print $thisNote->content,"\n";

# delete the note
$evernote->deleteNote({ guid => $guid });

# find notes
my $search = $evernote->findNotes({ keywords => $keywords, offset => $offset, max_notes => 5 });
for my $thisNote ( @{$search->notes} ) {
    print $thisNote->guid,"\n";
    print $thisNote->title,"\n";
}

METHODS

new({ authentication_token => $authentication_token })

Initialize the object.

my $evernote = Net::Evernote->new({
    authentication_token => $authentication_token
});

userStoreUrl is the url for user authentication, the default one is https://sandbox.evernote.com/edam/user

If you are in the production development, userStoreUrl should be https://www.evernote.com/edam/user

writeNote({ title => $title, content => $content })

Write a note to Evernote's server.

use Data::Dumper;

my $title = "my Perl poem";
my $content =<<EOF;
I wrote some Perl to say hello,
To a world I did not know.
Prepended line numbers there in tow,
I basically told it where to go.
EOF

my ($res,$guid);

eval {
    $res = $note->writeNote({
        title => $title,
        content => $content
    });
};

if ($@) {
    print Dumper $@;

} else {
    $guid = $res->guid;
    print "GUID I got for this note is $guid\n";
}

Both the title and content are strings.

dataStoreUrl is the url for handling note, the default one is https://sandbox.evernote.com/edam/note

If you are in the production development, dataStoreUrl should be https://www.evernote.com/edam/note

About GUID: Most data elements within a user's account (e.g. notebooks, notes, tags, resources, etc.) are internally referred to using a globally unique identifier that is written in a standard string format, for example, "8743428c-ef91-4d05-9e7c-4a2e856e813a".

getNote({ guid => $guid })

Get the note from the server.

use Data::Dumper;
my $thisNote;

eval {
    $thisNote = $note->getNote({ guid => $guid });
};

if ($@) {
    print Dumper $@;

} else {
    print $thisNote->title,"\n";
    print $thisNote->content,"\n";
}

guid is the globally unique identifier for the note.

For the content returned, you must know that they are ENML compatible. More stuff about ENML please see:

http://www.evernote.com/about/developer/api/evernote-api.htm#_Toc297053072

delNote({ guid => $guid })

Delete the note from Evernote's server.

use Data::Dumper;

eval {
    $note->delNote({ guid => $guid });
};

if ($@) {
    print Dumper $@;

} else {
    print "note with GUID $guid deleted\n";
}

guid is the globally unique identifier for the note.

findNotes({ keywords => $keywords, offset => $offset, max_notes => $maxNotes })

Find the notes which contain the given keywords.

use Data::Dumper;
my $search;

eval {
    $search = $note->findNotes({ keywords => "some words", offset => 0, max_notes => 5 });
};

if ($@) {
    print Dumper $@;

} else {
    for my $thisNote ( @{$search->notes} ) {
        print $thisNote->guid,"\n";
        print $thisNote->title,"\n";
    }
}

offset - The numeric index of the first note to show within the sorted results, default 0

maxNotes - The most notes to return in this query, default 1

SEE ALSO

http://www.evernote.com/about/developer/api/

AUTHOR

David Collins <davidcollins4481@gmail.com>

BUGS/LIMITATIONS

If you have found bugs, please send email to <davidcollins4481@gmail.com>

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Net::Evernote

COPYRIGHT & LICENSE

Copyright 2013 David Collins, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.