https://github.com/meinside/pushbullet-go-helper
my pushbullet-go helper codes
https://github.com/meinside/pushbullet-go-helper
golang pushbullet
Last synced: 5 days ago
JSON representation
my pushbullet-go helper codes
- Host: GitHub
- URL: https://github.com/meinside/pushbullet-go-helper
- Owner: meinside
- Created: 2015-07-07T06:23:45.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-29T04:24:13.000Z (almost 11 years ago)
- Last Synced: 2025-11-20T19:24:43.142Z (7 months ago)
- Topics: golang, pushbullet
- Language: Go
- Size: 141 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# My Pushbullet helper for golang
## 1. install [pushbullet-go](https://github.com/mitsuse/pushbullet-go) and this helper
```
$ go get -u github.com/mitsuse/pushbullet-go/...
$ go get -u github.com/meinside/pushbullet-go-helper/...
```
## 2. import this helper
```go
// test_pbhelper.go
package main
import (
"fmt"
"github.com/meinside/pushbullet-go-helper"
)
```
## 3. send pushes
```go
func main() {
if pbhelper.SendNote("This is a note", "From Golang, through Pushbullet") {
fmt.Println("Push note was successful.")
}
if pbhelper.SendNoteToChannel("some_channel_for_testing", "This is a note", "From Golang, through Pushbullet") {
fmt.Println("Push note to channel was successful.")
}
if pbhelper.SendLink("This is a link", "From Golang, through Pushbullet", "http://www.golang.org") {
fmt.Println("Push link was successful.")
}
if pbhelper.SendLinkToChannel("some_channel_for_testing", "This is a link", "From Golang, through Pushbullet", "http://www.golang.org") {
fmt.Println("Push link to channel was successful.")
}
}
```
## 4. build your binary
```
$ go build -o /some/directory/test_pbhelper test_pbhelper.go
```
## 5. put your Pushbullet access token in a file
Token file must be named `.pushbullet.token` and placed in the same directory as your binary file.
```
$ vi /some/directory/.pushbullet.token
```
## 6. run
```
$ /some/directory/test_pbhelper
Push note was successful.
Push note to channel was successful.
Push link was successful.
Push link to channel was successful.
```