You are hereBlogs / Amedee's blog / Twitterbot
Twitterbot
Sinds kort heeft deze server ook zijn eigen Twitter account: @intrepid_server. Tot nu toe doet hij nog niet veel meer dan af en toe een fortune cookie in de wereld te gooien:
of hij laat zijn uptime weten:
Op het einde van de dagelijkse backup laat hij ook van zich horen:
De inhoud van
Al deze kleine maar fijne scriptjes maken gebruik van de schitterende PHP Twitter class van @tijsverkoyen.
Meer scriptjes volgen later!
<?php
include_once "twitter.php";
include_once "user.php";
$data = shell_exec('/usr/games/fortune -s -n 140 bofh-excuses');
$twi_user->updateStatus($data);
?>
include_once "twitter.php";
include_once "user.php";
$data = shell_exec('/usr/games/fortune -s -n 140 bofh-excuses');
$twi_user->updateStatus($data);
?>
<?php
include_once "twitter.php";
include_once "user.php";
$data = shell_exec('/usr/bin/uptime');
$twi_user->updateStatus($data);
?>
include_once "twitter.php";
include_once "user.php";
$data = shell_exec('/usr/bin/uptime');
$twi_user->updateStatus($data);
?>
<?php
include_once "twitter.php";
include_once "user.php";
$data = shell_exec('/usr/sbin/backup2l -s | tail -n 4 | head -n 1 | cut -f 2 -d "|" | sed "s/ //g"');
$twi_user->updateStatus("just made a ".$data." backup.");
?>
include_once "twitter.php";
include_once "user.php";
$data = shell_exec('/usr/sbin/backup2l -s | tail -n 4 | head -n 1 | cut -f 2 -d "|" | sed "s/ //g"');
$twi_user->updateStatus("just made a ".$data." backup.");
?>
user.php:
<?php
$twi_user = new Twitter("intrepid_server","password");
?>
$twi_user = new Twitter("intrepid_server","password");
?>
[...] Twitterbot | amedee.be amedee.be/twitterbot – view page – cached Ubuntu Acer Aspire One Linux Crunchbang email bluetooth Debian server rants webdesign Mobile Vikings Excel kranten spam humor browsers usb-stick bash ssh Drupal internet about opinie blog Twitter more tags Tweets about this link [...]
Nieuwe reactie inzenden