Skip to content
This repository was archived by the owner on Jul 7, 2022. It is now read-only.

Conversation

chesty
Copy link

@chesty chesty commented May 1, 2019

from pushbullet import Pushbullet
api_key = 'replace with your api key'
encryption_key = 'replace with your encryption key'
pb = Pushbullet(api_key, encryption_key)
device = pb.get_device('replace with your device nickname')
threads = pb.get_permanents(device)
for thread in threads:
messages = pb.get_permanent(device, thread['id'])
print(messages)

I guess it's using an undocumented api feature and i haven't
done extensive testing, for example I don't know if a cursor
is ever sent. I've tested url parameters like limit= and
modified_after= and they didn't appear to work.

chesty added 2 commits May 1, 2019 16:12
from pushbullet import Pushbullet
api_key = 'replace with your api key'
encryption_key = 'replace with your encryption key'
pb = Pushbullet(api_key, encryption_key)
device = pb.get_device('replace with your device nickname')
threads = pb.get_permanents(device)
for thread in threads:
    messages = pb.get_permanent(device, thread['id'])
    print(messages)

I guess it's using an undocumented api feature and i haven't
done extensive testing, for example I don't know if a cursor
is ever sent. I've tested url parameters like limit= and
modified_after= and they didn't appear to work.
import json

from pushbullet import Pushbullet

api_key = 'your api key'
encryption_key = 'your encryption key'
pb = Pushbullet(api_key, encryption_key)
device = pb.get_device('your device nickname')
threads = pb.get_threads(device)
for thread in json.loads(pb._decrypt_data(threads.get('ciphertext'))).get('threads'):
    messages = pb.get_thread(device, int(thread['id']))
    print(json.loads(pb._decrypt_data(messages.get('ciphertext'))))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant