Twython cursor and get_user_timeline doesn't know when to stop #365

Closed
opened 2014-12-16 13:42:43 -08:00 by chasrmartin · 8 comments
chasrmartin commented 2014-12-16 13:42:43 -08:00 (Migrated from github.com)
    timeline = []
    results = twitter.cursor(
        twitter.get_user_timeline
        , screen_name=customer_handle
        , count=200
        , include_entities=True
        , include_rts=1
    )
    count = 0
    for result in results:
        logger.debug("Got result, id: %s" % result['id_str'])
        count += 1
        if count > 1000: break
        timeline.append(result)

Here's some selected results:

retrieve_customer_timeline[77]: Got result, id: 524280237828231168
retrieve_customer_timeline[77]: Got result, id: 523492215642152960
retrieve_customer_timeline[77]: Got result, id: 523147764754956288
retrieve_customer_timeline[77]: Got result, id: 522931696573091841
retrieve_customer_timeline[77]: Got result, id: 522925316201644032
retrieve_customer_timeline[77]: Got result, id: 522862141448011776
retrieve_customer_timeline[77]: Got result, id: 522857627722985473
retrieve_customer_timeline[77]: Got result, id: 522823556078391296
retrieve_customer_timeline[77]: Got result, id: 522810925347123200
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
retrieve_customer_timeline[77]: Got result, id: 543084740492804096
``` timeline = [] results = twitter.cursor( twitter.get_user_timeline , screen_name=customer_handle , count=200 , include_entities=True , include_rts=1 ) count = 0 for result in results: logger.debug("Got result, id: %s" % result['id_str']) count += 1 if count > 1000: break timeline.append(result) ``` Here's some selected results: ``` retrieve_customer_timeline[77]: Got result, id: 524280237828231168 retrieve_customer_timeline[77]: Got result, id: 523492215642152960 retrieve_customer_timeline[77]: Got result, id: 523147764754956288 retrieve_customer_timeline[77]: Got result, id: 522931696573091841 retrieve_customer_timeline[77]: Got result, id: 522925316201644032 retrieve_customer_timeline[77]: Got result, id: 522862141448011776 retrieve_customer_timeline[77]: Got result, id: 522857627722985473 retrieve_customer_timeline[77]: Got result, id: 522823556078391296 retrieve_customer_timeline[77]: Got result, id: 522810925347123200 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 retrieve_customer_timeline[77]: Got result, id: 543084740492804096 ```
michaelhelmick commented 2015-03-28 04:54:49 -07:00 (Migrated from github.com)

When are you expecting results to stop?

When are you expecting results to stop?
chasrmartin commented 2015-03-28 07:59:06 -07:00 (Migrated from github.com)

After it retrieves a different bunch of results. If you observe above, it's repeatedly getting the same 200 messages over and over, never advancing through the timeline.

After it retrieves a different bunch of results. If you observe above, it's repeatedly getting the _same_ 200 messages over and over, never advancing through the timeline.
mandarvaze commented 2015-03-31 05:07:00 -07:00 (Migrated from github.com)

Duplicate of #325, #299, #300 ?
There seems to be pull request #332

Duplicate of #325, #299, #300 ? There seems to be pull request #332
ryanmcgrath commented 2016-02-18 00:10:58 -08:00 (Migrated from github.com)

Hmmm, this seems like it's been sitting for a bit. @michaelhelmick, am I stepping on your toes if I look into merging it this weekend? Seems like it's still a bug.

Hmmm, this seems like it's been sitting for a bit. @michaelhelmick, am I stepping on your toes if I look into merging it this weekend? Seems like it's still a bug.
michaelhelmick commented 2016-02-18 04:53:47 -08:00 (Migrated from github.com)

@ryanmcgrath be my guest. I wanted to cut a release by the end of this month. I just have a work deadline this week. So I'll have some time after that!

@ryanmcgrath be my guest. I wanted to cut a release by the end of this month. I just have a work deadline this week. So I'll have some time after that!
michaelhelmick commented 2016-04-30 02:52:59 -07:00 (Migrated from github.com)

@chasrmartin Sorry for getting to this so late. Can you try @eoso PR (#386) and let me know if that solves the issue? I'll merge if so!

@chasrmartin Sorry for getting to this so late. Can you try @eoso PR (#386) and let me know if that solves the issue? I'll merge if so!
RedactedCode commented 2017-09-05 09:58:24 -07:00 (Migrated from github.com)

Still experiencing this problem
Python2.7 on Linux.
The mentioned fix doesn't seem to have made it's way into the live release yet?

Still experiencing this problem Python2.7 on Linux. The mentioned fix doesn't seem to have made it's way into the live release yet?
michaelhelmick commented 2017-09-25 10:46:33 -07:00 (Migrated from github.com)

@RedactedCode it hasn't, waiting on @eoso to update the Pull Request

@RedactedCode it hasn't, waiting on @eoso to update the Pull Request
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/twython#365
No description provided.