(self, callback)
Opens a Realtime Event Stream
            https://docs.pushbullet.com/stream

            callback will be called with one argument, the JSON response
            from the server, nop messages are filtered.

            Arguments:
            callback -- The function to call on activity
Opens a Realtime Event Stream
            https://docs.pushbullet.com/stream
Opens a Realtime Event Stream https : // docs . pushbullet . com / stream
def realtime(self, callback):
        """ Opens a Realtime Event Stream
            https://docs.pushbullet.com/stream

            callback will be called with one argument, the JSON response
            from the server, nop messages are filtered.

            Arguments:
            callback -- The function to call on activity
        """

        url = "wss://stream.pushbullet.com/websocket/" + self.apiKey
        ws = create_connection(url)
        while 1:
            data = ws.recv()
            data = json.loads(data)
            if data["type"] != "nop":
                callback(data)
def realtime ( self , callback ) : url = "wss://stream.pushbullet.com/websocket/" + self . apiKey ws = create_connection ( url ) while 1 : data = ws . recv ( ) data = json . loads ( data ) if data [ "type" ] != "nop" : callback ( data )