Does the since param in twitter.Api.GetUserTimeline do anything?

130 views
Skip to first unread message

Terry Jones

unread,
Jun 14, 2009, 8:53:52 PM6/14/09
to python-...@googlegroups.com
Does the 'since' param in twitter.Api.GetUserTimeline do anything? I tried
pulling back some old tweets, but the param seems to be ignored.

The docs tell me to send an HTTP-formatted date (without telling me quite
what that is). It reads like I should be able to pass something like "Fri
Dec 1 12:00:00 +0000 2006" (which was before my first ever tweet). But no
matter what date I send, I always get the most recent tweets back. The
count param works, but if I make it too large (e.g., 2000), I get an
urllib2.HTTPError: HTTP Error 502: Bad Gateway.

Thanks for any help.

Terry

Marc Hartstein

unread,
Jun 14, 2009, 9:03:51 PM6/14/09
to python-twitter
Excerpts from Terry Jones's message of Sun Jun 14 20:53:52 -0400 2009:

>
> Does the 'since' param in twitter.Api.GetUserTimeline do anything? I tried
> pulling back some old tweets, but the param seems to be ignored.

Yeah, the twitter API is a little weird there. Try using the 'page'
parameter as well as 'since' and 'count'.

The API sends you the most recent 'count' statuses which are more recent
than 'since' (or 'since_id'). If you set 'page' greater than 1, it will
skip the most recent (page-1)*count statuses to find a group to return.

Last time I checked the API, 'count' could not exceed 200.

signature.asc

Terry Jones

unread,
Jun 15, 2009, 5:47:18 AM6/15/09
to python-...@googlegroups.com
>>>>> "Marc" == Marc Hartstein <marc...@gmail.com> writes:

Marc> Excerpts from Terry Jones's message of Sun Jun 14 20:53:52 -0400 2009:


>> Does the 'since' param in twitter.Api.GetUserTimeline do anything? I
>> tried pulling back some old tweets, but the param seems to be ignored.

Marc> Yeah, the twitter API is a little weird there. Try using the 'page'
Marc> parameter as well as 'since' and 'count'.

Hi Marc.

Thanks for the reply. GetUserTimeline doesn't take a page argument,
though. (I'm looking at the Twitter Python code from the svn trunk).

Marc> Last time I checked the API, 'count' could not exceed 200.

It worked for me last night with 1500.

Terry

Maex

unread,
Jun 15, 2009, 4:30:27 AM6/15/09
to python-twitter


On Jun 15, 2:53 am, Terry Jones <terry.jo...@gmail.com> wrote:
> Does the 'since' param in twitter.Api.GetUserTimeline do anything? I tried
> pulling back some old tweets, but the param seems to be ignored.

http://apiwiki.twitter.com/REST+API+Changelog
April 8, 2009
* Changed (REST): The since parameter and If-Modified-Since
header are
no longer supported.

It should be removed from the python-twitter API, too.

\Maex

DeWitt Clinton

unread,
Jun 15, 2009, 10:21:34 AM6/15/09
to python-...@googlegroups.com
I fixed this in the -dclinton branch a while back ... just back-ported it to /trunk now:


On that topic, I'm increasingly comfortable with the -dclinton branch (the major change being a switch to protobufs instead of hand-coded datatypes) being an okay long term direction.  But that's a major new dependency, and one I wouldn't want to force on people.  Once it settles down a bit more I'll ask for opinions about whether it should become the new trunk.

-DeWitt

Terry Jones

unread,
Jun 19, 2009, 9:17:40 PM6/19/09
to python-...@googlegroups.com
There's a small cut&paste bug in the 0.7-devel release (svn revision 171):

if max_id:
try:
parameters['max_id'] = int(count)
except:
raise TwitterError("max_id must be an integer")

should be int(max_id).

Terry

DeWitt Clinton

unread,
Jun 21, 2009, 12:31:16 AM6/21/09
to python-twitter
Fixed in trunk in r174. Please verify. Thanks!

http://code.google.com/p/python-twitter/source/detail?r=174

Terry Jones

unread,
Jun 21, 2009, 8:53:40 AM6/21/09
to python-...@googlegroups.com
Works for me. Thanks a lot.

Terry

>>>>> "DeWitt" == DeWitt Clinton <dcli...@gmail.com> writes:
DeWitt> Fixed in trunk in r174. Please verify. Thanks!

DeWitt> http://code.google.com/p/python-twitter/source/detail?r=174

Markus Stumpf

unread,
Jun 22, 2009, 4:27:12 AM6/22/09
to python-...@googlegroups.com
On Sat, Jun 20, 2009 at 09:31:16PM -0700, DeWitt Clinton wrote:
> Fixed in trunk in r174. Please verify. Thanks!

Shouldn't this better be a long()?

\Maex

Reply all
Reply to author
Forward
0 new messages