pushbullet-notifier/app.php

20 lines
417 B
PHP
Raw Normal View History

2017-03-17 18:43:45 -07:00
<?php
require 'vendor/autoload.php';
2017-08-25 22:40:19 -07:00
$loader = new josegonzalez\Dotenv\Loader(__DIR__.'/.env');
$loader->parse();
$loader->putEnv();
2017-03-17 18:43:45 -07:00
2017-08-25 22:40:19 -07:00
$token = getenv('PB_TOKEN');
2017-03-17 18:43:45 -07:00
2017-08-25 22:40:19 -07:00
try {
$pushbullet = new Pushbullet\Pushbullet($token);
} catch (\Exception $e) {
print $e->getMessage() . PHP_EOL;
2017-03-17 18:43:45 -07:00
}
2017-08-25 22:40:19 -07:00
$pushResult = $pushbullet
->device('Google Pixel XL')
->pushNote('Hello!', 'How are you?')
;
print_r($pushResult);