Re: About the json output and the number of results shown.

Subject: Re: About the json output and the number of results shown.

Date: Wed, 12 Jan 2011 22:39:45 +0000

To: notmuch@notmuchmail.org

Cc:

From: Mike Kelly


I've had other problems attempting to use the JSON interface recently.
For starters, if I'm simply trying to retrieve a single message, the
interface is rather awkard. I seem to need to do something like:

    my $json = `notmuch show --format=json id:$message_id`;
    my $parsed_json = decode_json($json);
    my $message = $parsed_json->[0][0][0];

And, when I'm doing my search earlier to even find those message ids, I
need to do a check to `notmuch count` first to see if I'll even get any
results, because the 0 result case is not valid JSON.

Of course, any feedback, like "you're doing it wrong" would be helpful.
My script is available at:

    http://git.pioto.org/gitweb?p=pioto-scripts.git;a=blob;f=mail/notmuch-poll.pl;hb=master

-- 
Mike Kelly

Thread: