Added .env
This commit is contained in:
parent
7c8e77de98
commit
4c39ba7699
|
@ -2,3 +2,4 @@
|
|||
vendor/
|
||||
*~
|
||||
composer.lock
|
||||
.env
|
||||
|
|
21
app.php
21
app.php
|
@ -1,15 +1,20 @@
|
|||
<?php
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
$loader = new josegonzalez\Dotenv\Loader(__DIR__.'/.env');
|
||||
$loader->parse();
|
||||
$loader->putEnv();
|
||||
|
||||
$token = getenv('NOTI_PB');
|
||||
$token = getenv('PB_TOKEN');
|
||||
|
||||
if(empty($token)) {
|
||||
throw new InvalidArgumentException('Please set your Pushbullet API token');
|
||||
try {
|
||||
$pushbullet = new Pushbullet\Pushbullet($token);
|
||||
} catch (\Exception $e) {
|
||||
print $e->getMessage() . PHP_EOL;
|
||||
}
|
||||
$pb = new Pushbullet\Pushbullet($token);
|
||||
|
||||
print_r($pb->getDevices());
|
||||
|
||||
//$pb->device('Chrome')->pushNote('Done', 'Your thing has finished on repos.');
|
||||
$pb->device('Huawei Nexus 6P')->pushNote('Done', 'Finished pushing');
|
||||
$pushResult = $pushbullet
|
||||
->device('Google Pixel XL')
|
||||
->pushNote('Hello!', 'How are you?')
|
||||
;
|
||||
print_r($pushResult);
|
|
@ -1,10 +1,18 @@
|
|||
{
|
||||
"name": "sikofitt/pushbullet-notifier",
|
||||
"description": "Simple php app to alert you after jobs are done",
|
||||
"license": "GPL-3.0",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Sikofitt\\Pushbullet\\": "src/Sikofitt/Pushbullet/"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"ivkos/pushbullet": "^3.1",
|
||||
"symfony/console": "^3.2",
|
||||
"symfony/event-dispatcher": "^3.2",
|
||||
"symfony/config": "^3.2",
|
||||
"symfony/dotenv": "dev-master"
|
||||
"josegonzalez/dotenv": "^3.1"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue