From: Mike Kelly <pioto@pioto.org>
To: notmuch@notmuchmail.org
Subject: Re: About the json output and the number of results shown.
Date: Wed, 12 Jan 2011 22:39:45 +0000 [thread overview]
Message-ID: <1294871985-ner-781@everglades> (raw)
In-Reply-To: <AANLkTi=Mzu9bu3y0RKB5YZUpZOT9qujXgxtpB-8Bvk=2@mail.gmail.com>
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
next prev parent reply other threads:[~2011-01-12 22:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-12 18:37 About the json output and the number of results shown Christophe-Marie Duquesne
2011-01-12 22:39 ` Mike Kelly [this message]
2011-01-28 20:44 ` Carl Worth
2011-01-29 15:59 ` Mike Kelly
2011-01-13 10:34 ` Sebastian Spaeth
2011-01-13 18:46 ` Christophe-Marie Duquesne
2011-01-14 13:48 ` Sebastian Spaeth
2011-01-28 20:27 ` Carl Worth
2011-01-28 20:40 ` Carl Worth
2011-02-13 6:29 ` Jeff Waugh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1294871985-ner-781@everglades \
--to=pioto@pioto.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).