0

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?

1 Answers1

0

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.

Chris Pushbullet
  • 1,039
  • 9
  • 10
  • Thanks. I was initially put off because it appeared I would have to switch to the v2 API or change libraries. But thanks to your hints, I looked into https://github.com/randomchars/pushbullet.py/blob/master/pushbullet/pushbullet.py and found that it already supports a modified_after and limit parameter in the get_pushes operation. modified_after, active and a limit are all good solutions to my problem. – Bingu Bingme Mar 24 '15 at 13:02