- Get an account from pushbullet.
- Find the Access Tokens from the account setting page.
- Type in your terminal
curl --header 'Access-Token: <your_access_token_here>' \
https://api.pushbullet.com/v2/users/me
- Get the results something like
{
"created": 1.381092887398433e+09,
"email": "elon@teslamotors.com",
"email_normalized": "elon@teslamotors.com",
"iden": "ujpah72o0",
"image_url": "https://static.pushbullet.com/missing-image/55a7dc-45",
"max_upload_size": 2.62144e+07,
"modified": 1.441054560741007e+09,
"name": "Elon Musk"
}
- Create one .rpushbullet.json in your home directory with
{
"key": <your_access_token_here>,
"created": 1.381092887398433e+09,
"email": "elon@teslamotors.com",
"email_normalized": "elon@teslamotors.com",
"iden": "ujpah72o0",
"image_url": "https://static.pushbullet.com/missing-image/55a7dc-45",
"max_upload_size": 2.62144e+07,
"modified": 1.441054560741007e+09,
"name": "Elon Musk"
}
- install RPushbullet in R.
install.packages("RPushbullet")
- Test the RPushbullet with
library(RPushbullet)
pbPost("note", "A simple title", "A message\nWith a second line")
Pretty the same as setup in Mac. However, I cannot find the right home directory in Windows. It turns out that
Sys.getenv()
Sys.getenv("HOME")
can get the right environment variables. put the json file under this home directory.