pushbullet.py icon indicating copy to clipboard operation
pushbullet.py copied to clipboard

get_pushes() doesn't stop automatically after getting all possible pushes

Open andrewjbennett opened this issue 8 years ago • 2 comments

It just checks it has a "cursor" field, but it seems to have this even when it's reached the last page of pushes. This eats through rate limit very very quickly.

I'll send a pull request with a patch within the next few days hopefully.

andrewjbennett avatar Jul 25 '16 12:07 andrewjbennett

@andrewjbennett did you ever fix this?

ghost avatar Dec 09 '16 01:12 ghost

I've found a reasonable workaround is to use the modified_after and limit variables.

def grab_pushes(limit=10):
    print("Fetching pushes.")

    global last_check

    pushes = pb.get_pushes(modified_after=last_check, limit=limit)
    last_check = time.time()

    for push in pushes:
        # Process pushes.

    print("Done.")

IamTheCarl avatar Jan 10 '18 17:01 IamTheCarl