richard-better / pushbullet.py

A python client for http://pushbullet.com
MIT License
575 stars 110 forks source link

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

Open andrewjbennett opened 8 years ago

andrewjbennett commented 8 years ago

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.

ghost commented 7 years ago

@andrewjbennett did you ever fix this?

IamTheCarl commented 6 years ago

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.")