Message from discussion
api returning wrong number of posts (limit)
Received: by 10.224.39.72 with SMTP id f8mr3121109qae.7.1342101469807;
Thu, 12 Jul 2012 06:57:49 -0700 (PDT)
X-BeenThere: tumblr-api@googlegroups.com
Received: by 10.229.178.68 with SMTP id bl4ls2244547qcb.9.gmail; Thu, 12 Jul
2012 06:57:48 -0700 (PDT)
Received: by 10.224.208.2 with SMTP id ga2mr3235347qab.8.1342101468242;
Thu, 12 Jul 2012 06:57:48 -0700 (PDT)
Received: by 10.224.208.2 with SMTP id ga2mr3235346qab.8.1342101468219;
Thu, 12 Jul 2012 06:57:48 -0700 (PDT)
Return-Path: <jo...@tumblr.com>
Received: from mail-qc0-f178.google.com (mail-qc0-f178.google.com [209.85.216.178])
by gmr-mx.google.com with ESMTPS id ft6si1433537qcb.0.2012.07.12.06.57.47
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 12 Jul 2012 06:57:47 -0700 (PDT)
Received-SPF: pass (google.com: domain of jo...@tumblr.com designates 209.85.216.178 as permitted sender) client-ip=209.85.216.178;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jo...@tumblr.com designates 209.85.216.178 as permitted sender) smtp.mail=jo...@tumblr.com; dkim=pass header...@tumblr.com
Received: by mail-qc0-f178.google.com with SMTP id j9so1646955qch.23
for <tumblr-api@googlegroups.com>; Thu, 12 Jul 2012 06:57:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=tumblr.com; s=google;
h=date:from:to:message-id:in-reply-to:references:subject:x-mailer
:mime-version:content-type;
bh=gj3pjGaUklpHDGJqndIoiT069ZKDtzvgkXku3jhbsqo=;
b=pmt2PrV5y87/YzZ512KfjEegBbmvR3cQEKLDuqYAfTW1fWWopK91Oc8QaPYBqWwOgv
zvYymBO6CX5uJWLmduoo7hq9YIhz8aTnfy4fHE3hnY7qAyHQ9UqRC6olq7QTXRqxiuUx
dzvjiZvnLy4M4EyZa+zAuxkds4A7DCRG/XS3Q=
d=google.com; s=20120113;
h=date:from:to:message-id:in-reply-to:references:subject:x-mailer
:mime-version:content-type:x-gm-message-state;
bh=gj3pjGaUklpHDGJqndIoiT069ZKDtzvgkXku3jhbsqo=;
b=Mytyn6i49DxevQDzZy5QwNan3EjafAkYoI41GgEkEv4eSXHSjjfI1GwusIoGzOkRY1
ThXMdtRCSCSKbVLavB76CHPOwNRUzM/HvQD0EPLylxLDyw1s+DntG3o6uocglBw7Oz9/
ZnjZqv4oGphQaFP7ZzIR1jwtcmCg44z5p/tLuLZc6h7eyF+uEfsQVgV8OwxMJZf70J7x
evifFjoFfGsIyNNHEs4rRJFW9DxjAu6D2C2TzMQXcAVFhThPCYO/v5PrSXXa2y416B6S
HOA47GWnT2Cv0QvBYAGrbchlarJvXmDlBRnppSKWpApTzR11wICMLc3I5GwqhLR8FRxm
sGGg==
Received: by 10.224.195.199 with SMTP id ed7mr4326314qab.22.1342101467698;
Thu, 12 Jul 2012 06:57:47 -0700 (PDT)
Return-Path: <jo...@tumblr.com>
Received: from [192.168.130.73] (static-96-239-100-47.nycmny.fios.verizon.net. [96.239.100.47])
by mx.google.com with ESMTPS id bo5sm7269465qab.1.2012.07.12.06.57.47
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 12 Jul 2012 06:57:47 -0700 (PDT)
Date: Thu, 12 Jul 2012 09:57:49 -0400
From: John Bunting <jo...@tumblr.com>
To: tumblr-api@googlegroups.com
Message-ID: <051905433D3145809330DC1E63151...@tumblr.com>
In-Reply-To: <-6574182473423241318@unknownmsgid>
References: <e0ec10e9-fb38-49fe-bbe0-9e5bf4a156e2@googlegroups.com>
<CAJx59jkyw6ChqJLrQ71DfS1KcBtyF=W851yqebSXgyQHtMT...@mail.gmail.com>
<-6574182473423241318@unknownmsgid>
Subject: Re: api returning wrong number of posts (limit)
X-Mailer: sparrow 1.6.1 (build 1081.52)
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="4ffed7dd_4516dde9_41e"
X-Gm-Message-State: ALoCoQmRN1YSR3foAeUVHJGuwYXX5B+68gMdpAjc6+TN2+ig/tfZrO48I19dINGF0sB/ehy4wDdz
--4ffed7dd_4516dde9_41e
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hey Walid,
We are aware of the bug and it's been filed. It's on the road map to fix but some other things have been pushed in front of it.
Thanks for the email!
--
John Bunting
Simplicity is a prerequisite for reliability
--Edsger W. Dijkstra
On Wednesday, July 11, 2012 at 3:04 AM, Walid Wannous wrote:
> Felix,
> Thank you for your reply. Ill try to work around these bugs. Is there any plan to fix these bugs any soon?
>
>
>
> On Jul 11, 2012, at 7:18 AM, Felix Bonkoski <felixschwer...@gmail.com (mailto:felixschwer...@gmail.com)> wrote:
>
> > These are know bugs
> >
> > When you request a limit of X posts, the API may not return exactly X posts.
> >
> > I think this has to do with posts that have been deleted / marked private on a blog. The API "skips" over them, but instead of filling in the missing posts with more posts, it just returns some number <= X.
> >
> > As such, you should *never* use the number of posts returned from the .../blog/<host>/posts call when you set the Offset parameter to fetch more.
> >
> > Eg,
> > Suppose you fetch offset=0, limit=10 and you get 7 posts back.
> > On your next call to fetch more posts, you *still use* offset=10, limit=10 and NOT offset=7, limit=10
> >
> >
> > The "total posts" number you refer to is *Not* the number of posts *returned* by the call to .../blog/<host>/posts
> >
> > It is meant to be the "total number of posts on this blog"
> >
> > However, *note* there is another known bug here! The number returned for "Total Posts" is often incorrect!
> >
> > So do not depend on this number when you are paginating through posts, to determine if you reached the end!
> >
> > Felix
> >
> >
> >
> > On Mon, Jul 9, 2012 at 11:17 AM, Walid Wannous <wwann...@koein.com (mailto:wwann...@koein.com)> wrote:
> > > Calling http://api.tumblr.com/v2/blog/toucheydesign.tumblr.com/posts?api_key=9ETjA------------------------------------------JtQewBmeFIM&tag=photography&offset=1&limit=10
> > > returns only 7 posts in the json although i have specified a limit of 10 and the total posts is 49 as mentioned in the json file.
> > >
> >
> >
> >
> >
> >
> > --
> > Felix Bonkoski
--4ffed7dd_4516dde9_41e
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<div style=3D=22font-family: Helvetica; font-size: 12px; =
=22>Hey Walid,<div><br></div><div>We are aware of the bug and it's been f=
iled. It's on the road map to fix but some other things have been pushed =
in front of it.</div><div><br></div><div>Thanks for the email=21</div></d=
iv>
<div><div><br></div><div style=3D=22font-family: Helvetic=
a; font-size: 10pt; =22>-- </div><div style=3D=22font-family: Helvet=
ica; font-size: 10pt; =22>John Bunting</div><div style=3D=22font-family: =
Helvetica; font-size: 10pt; =22><br></div><div style=3D=22font-family: He=
lvetica; font-size: 10pt; =22>Simplicity is a prerequisite for reliabilit=
y</div><div style=3D=22font-family: Helvetica; font-size: 10pt; =22> =
; --Edsger W. Dijkstra</div><div><br></div></div>
=20
<p style=3D=22color: =23A0A0A8;=22>On Wednesday, July 11,=
2012 at 3:04 AM, Walid Wannous wrote:</p>
<blockquote type=3D=22cite=22 style=3D=22border-left-styl=
e:solid;border-width:1px;margin-left:0px;padding-left:10px;=22>
<span><div><div><div>=46elix,</div><div>Thank you for=
your reply. Ill try to work around these bugs. Is there any plan to fix =
these bugs any soon=3F<br><br><div><span style=3D=22=22><br>
</span></div></div><div><br>On Jul 11, 2012, at 7:18 AM, =46elix Bonkoski=
<<a href=3D=22mailto:felixschwermut=40gmail.com=22>felixschwermut=40g=
mail.com</a>> wrote:<br><br></div><blockquote type=3D=22cite=22><div>T=
hese are know bugs<div>
<br></div><div><ol><li>When you request a limit of X posts, the API may n=
ot return exactly X posts.<br><br>I think this has to do with posts that =
have been deleted / marked private on a blog. The API =22skips=22 over th=
em, but instead of filling in the missing posts with more posts, it just =
returns some number <=3D X.<br>
<br>As such, you should *never* use the number of posts returned from the=
.../blog/<host>/posts call when you set the Offset parameter=
to fetch more.<br><br>Eg,<br>Suppose you fetch offset=3D0, limit=3D10 &n=
bsp;and you get 7 posts back. <br>
On your next call to fetch more posts, you *still use* offset=3D10, limit=
=3D10 and NOT offset=3D7, limit=3D10<br><br><br></li><li>The =
=22total posts=22 number you refer to is *Not* the number of posts *retur=
ned* by the call to .../blog/<host>/posts<br>
<br>It is meant to be the =22total number of posts on this blog=22<br><br=
>However, <b>*note*</b> there is another known bug here=21 The=
number returned for =22Total Posts=22 is often incorrect=21<br><br>So do=
not depend on this number when you are paginating through posts, to dete=
rmine if you reached the end=21</li>
</ol><div><br></div></div><div>=46elix</div><div><br></div><div><br><br><=
div>On Mon, Jul 9, 2012 at 11:17 AM, Walid Wannous <span dir=3D=22ltr=22>=
<<a href=3D=22mailto:wwannous=40koein.com=22 target=3D=22=5Fblank=22>w=
wannous=40koein.com</a>></span> wrote:<br><blockquote type=3D=22cite=22=
><div>
Calling <a href=3D=22http://api.tumblr.com/v2/blog/toucheydesign.tum=
blr.com/posts=3Fapi=5Fkey=3D9ETjA----------------------------------------=
--JtQewBme=46IM&tag=3Dphotography&offset=3D1&limit=3D10=22 ta=
rget=3D=22=5Fblank=22>http://api.tumblr.com/v2/blog/toucheydesign.tumblr.=
com/posts=3Fapi=5Fkey=3D9ETjA------------------------------------------Jt=
QewBme=46IM&tag=3Dphotography&offset=3D1&limit=3D10</a> =
<div>
returns only 7 posts in the json although i have specified a limit of 10 =
and the total posts is 49 as mentioned in the json file.</div></div></blo=
ckquote></div><br><br clear=3D=22all=22><div><br></div>-- <br><div>=46eli=
x Bonkoski</div>
<br>
</div>
</div></blockquote></div></div></span>
=20
=20
=20
=20
</blockquote>
=20
<div>
<br>
</div>
--4ffed7dd_4516dde9_41e--