Client for Pushbullet API

Piotr Czajkowski dd409a9d2d Activated deepsource 3 năm trước cách đây
.github 5885fdfd2a Added tests 3 năm trước cách đây
.deepsource.toml dd409a9d2d Activated deepsource 3 năm trước cách đây
LICENSE.md b4317f5d84 Starting 3 năm trước cách đây
README.md 8b7e505b33 Additional explanation 3 năm trước cách đây
bullet.go aabaebfbce Added instructions for ListPushes 3 năm trước cách đây
bullet_test.go 1519ccf6d4 Added ListPushes 3 năm trước cách đây
devices.go a2cec82518 Added ListDevices 3 năm trước cách đây
error.go 195375e3e4 No need for export 3 năm trước cách đây
fileUpload.go 2d0b1bdd4f SendFile can now send file to specific device 3 năm trước cách đây
push.go 40e0102289 SendLink can send link to specific device 3 năm trước cách đây
pushInterface.go 396a5812ee Maybe a bit better 3 năm trước cách đây
pushes.go bde165f071 Stupid mistake 3 năm trước cách đây

README.md

bullet

Go Report Card

Initialize client

b := bullet.NewBullet("YOUR_TOKEN")

Send note, use empty string in place of deviceID to send to all devices

err := b.SendNote("testTitle", "testText", "deviceID")
if err != nil {
    log.Fatal(err)
}

Send link, use empty string in place of deviceID to send to all devices

err := b.SendLink("testTitle", "testText", "https://abc.com", "deviceID")
if err != nil {
    log.Fatal(err)
}

Send file, use empty string in place of deviceID to send to all devices

err := b.SendFile("testFile", "Something", "./test.txt", "deviceID")
if err != nil {
    log.Fatal(err)
}

List devices

devices, err := b.ListDevices()
if err != nil {
    t.Error(err)
}

List all active pushes (modifiedAfter can be nil, limit <= 0 gives default of 500). Cursor is returned with every call (in Devices struct) and is used for pagination, so if you want to see next page of results in your next call provide cursor received from the last call.

devices, err := b.ListPushes(true, nil, 0, "")
if err != nil {
    t.Error(err)
}