Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Sample code #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Sample code #1

wants to merge 5 commits into from

Conversation

nobuoka
Copy link

@nobuoka nobuoka commented May 28, 2012

Although evernote-sdk in othre languages has sample scripts, evernote-sdk-perl doesn't have sample code. So I ported sample code from evernote-sdk-ruby to evernote-sdk-perl.

@sethhitch
Copy link
Contributor

This doesn't seem to work for me:

ERROR at EDAMTest.pl line 126.
$VAR1 = bless( {
                 'code' => 0,
                 'message' => 'Missing version identifier'
               }, 'Thrift::TException' );

I'm using Perl 5.17.0 on Mac OS 10.7.4

nobuoka added 5 commits July 22, 2012 20:54
…nstallation check is added)

If LWP::Protocol::https is not installed, communication to evernote server via
thrift is failed. Error message is not clear at the time, and so it is
difficult to find the reason of that error. Therefore, the line
'use LWP::Protocol::https;' is added.
@nobuoka
Copy link
Author

nobuoka commented Jul 22, 2012

Thanks for your reply. There are a few reason why the following exception occur.

ERROR at EDAMTest.pl line 126.
$VAR1 = bless( {
        'code' => 0,
        'message' => 'Missing version identifier'
}, 'Thrift::TException' );

For example,

  • LWP::Protocol::https is not installed (this module is needed by Thrift::HttpClient, but it is not clearly documented);
  • network is disconnected;
  • connection timeout is occured;
  • and so on...

I think LWP::Protocol::https is not installed on your system. Please check it.

I think it is not good idea that the necessity of that module is not clearly documented, so I added the line to check if that module is installed. Please see : commit 70a4803 (This commit includes error handling change also)

And I'm sorry, but I rebased my sample_code branch. So please delete old sample_code branch on your local repository before pulling new sample_code branch.

@sethhitch
Copy link
Contributor

You're right, installing LWP::Protocol::https resolved the problem. I'd like to update the README with the required modules. I installed:

HTTP::Request
LWP
IO::String
Bit::Vector
Class::Accessor
LWP::Protocol::https
Exception::Class

Do you know of anything else that should be added to that list?

@nobuoka
Copy link
Author

nobuoka commented Jul 23, 2012

It's nice to solve the problem.

I think your list covers all necessary modules. (I verified that by using Perl 5.16.0 and Perl 5.17.2.)
To be exact, LWP is not needed directly, but LWP::UserAgent is needed directly by the evernote-sdk-perl library.
And, Exception::Class is not needed by the evernote-sdk-perl library, but is needed by sample code (sample/client/EDAMTest.pl).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants