0

Im working on an AutoIt application, and today I found out Pushbullet blocked me from reading from their database because I performed too many database reads, this is the actual error message:

"You have been blocked for performing too many database reads per user with this app."

I contacted them to see if I can get my block removed, but while Im waiting for their response I would also like to know what I was doing wrong.

I want to find and display new Notifications, so I was using this code:

$oHTTP = ObjCreate("WinHTTP.WinHTTPRequest.5.1")
$access_token = $PushToken
$oHTTP.Open("Get", "https://api.pushbullet.com/v2/pushes?active=true", False)
$oHTTP.SetCredentials($access_token, "", 0)
$oHTTP.SetRequestHeader("Content-Type", "application/json")
$oHTTP.Send()
$Result = $oHTTP.ResponseText

It was set on a two minutes timer, which I guess triggered the block, but then, whats the right approach to this problem without performing too many requests to their DB (and getting blocked)?

Limon Monte
  • 52,539
  • 45
  • 182
  • 213
RxBlacky
  • 1
  • 1
  • Hey, I did that. It wasn't obvious to me who was causing the reads, but this script was doing 5 times the reads of everyone else combined. This effectively grabs the user's last 500 pushes every time it runs, so every 2 minutes I guess. Which is 15k reads per hour. What is the script attempting to do? – Chris Pushbullet May 28 '15 at 18:53
  • Hi, and thank your for you incredibly fast response, its supposed to grab only the last push received and read/show its contents, is there any way I can achieve that without being an annoyance? – RxBlacky May 28 '15 at 19:01
  • I forgot to say its supposed to grab and display/read the contents of the last push received **periodically**. – RxBlacky May 28 '15 at 19:09

1 Answers1

1

Since this question never got a proper answer. The answer was that I banned a script that was doing a very large number of reads in an inefficient manner. We have better ratelimiting now: https://docs.pushbullet.com/#ratelimiting which should help avoid this issue.

To use Pushbullet efficiently, you should wait for a tickle message from the stream (https://docs.pushbullet.com/#stream) and then fetch the new items (https://docs.pushbullet.com/#syncing-changes). If you only care to read the most recent push, an easier way is to call https://api.pushbullet.com/v2/pushes?limit=1 .

This is not necessary for smaller apps, but when you have thousands of users and you're polling every 2 minutes, it adds up.

Chris Pushbullet
  • 1,039
  • 9
  • 10