Search code examples
pythonpushbullet

Expunge unwanted pushbullet pushes


I use the python pushbullet.py library to access my pushbullet pushes.

After some months of pushing messages back and forth, I now have over 5000 pushes being retrieved when I do pb.get_pushes(). This is taking quite a long time to retrieve since it ends up being more than 700KB. I have already deleted the pushes by doing something like this:

 s,p=pb.get_pushes()
 for i in p:
  ident=i.get("iden")
  try:
   pb.dismiss_push(ident)
   pb.delete_push(ident)
  except:
   pass

But even with this, I have over 5000 push records where active=False. How can I expunge the unwanted pushes so that they don't sit around?


Solution

  • You can actually delete all pushes with a DELETE to https://api.pushbullet.com/v2/pushes: https://docs.pushbullet.com/#delete-all-pushes

    It sounds like what you actually want though, is to not see deleted pushes when retrieving pushes. To do that, you want to set active=true on the request to /v2/pushes, as mentioned in the bootstrapping section: https://docs.pushbullet.com/#bootstrapping

    The ideal way to download only new pushes is to use modified_after on the request to /v2/pushes so that you only get new pushes, and don't have to download all active pushes every time, but I admit that managing modified_after is a bit of a pain and a more simple syncing solution may happen in the future.