2
0
mirror of https://github.com/narkoz/hacker-scripts synced 2025-08-22 18:37:10 +00:00

Merge pull request #96 from Stunt/master

hangover.rb php port
This commit is contained in:
Nihad Abbasov 2015-12-04 06:39:02 +04:00
commit 5422e24d3d
2 changed files with 23 additions and 1 deletions

View File

@ -1,6 +1,7 @@
{ {
"require": { "require": {
"bestnetwork/telnet": "^1.0", "bestnetwork/telnet": "^1.0",
"vlucas/phpdotenv": "^2.0" "vlucas/phpdotenv": "^2.0",
"twilio/sdk": "^4.6"
} }
} }

21
php/hangover.php Normal file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env php
<?php
require 'vendor/autoload.php';
(new Dotenv\Dotenv(__DIR__))->load();
(strpos(exec('who'), getenv('USER')) === false) or exit('session found');
$my_number = '+xxx';
$number_of_boss = '+xxx';
$excuse = ['Locked out', 'Pipes broke', 'Food poisoning', 'Not feeling well'];
$excuse = $excuse[array_rand($excuse)];
$twilio = new Services_Twilio(getenv('TWILIO_ACCOUNT_SID'), getenv('TWILIO_AUTH_TOKEN'));
$twilio->account->messages->sendMessage(
$my_number,
$number_of_boss,
"Gonna work from home. {$excuse}"
);
echo "Message sent at: #".date('Y-m-d')." | Excuse: {$excuse}";