You are hereBlogs / Amedee's blog / Twitterbot

Twitterbot


By Amedee - Posted on 31 Augustus 2009

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:
<?php
include_once "twitter.php";
include_once "user.php";
$data = shell_exec('/usr/games/fortune -s -n 140 bofh-excuses');
$twi_user->updateStatus($data);
?>
of hij laat zijn uptime weten:
<?php
include_once "twitter.php";
include_once "user.php";
$data = shell_exec('/usr/bin/uptime');
$twi_user->updateStatus($data);
?>
Op het einde van de dagelijkse backup laat hij ook van zich horen:
<?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.");
?>
De inhoud van user.php:
<?php
$twi_user = new Twitter("intrepid_server","password");
?>
Al deze kleine maar fijne scriptjes maken gebruik van de schitterende PHP Twitter class van @tijsverkoyen. Meer scriptjes volgen later!

[...] 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

  • Textual smileys will be replaced with graphical ones.
  • Toegelaten HTML-tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <strike> <hr> <table> <tr> <td> <th>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo], [[foo]].
  • Adressen van webpagina's en e-mailadressen worden automatisch naar links omgezet.
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.
  • You may quote other posts using [quote] tags.
  • Regels en paragrafen worden automatisch gesplitst.

Meer informatie over formaatmogelijkheden

Reclame... ;-)

Met dank aan
  • Jasmina
  • Celine
  • Pieter
  • Jeff
  • Hans
  • Jurgen
  • Jurgen
  • Marijke
  • Amedee
  • Erik
  • Danny
  • Sofie
  • Lars
  • Christophe
  • Peter
  • Jeroen
  • Jurgen
om mij een gratis herlading twv €15 te bezorgen!

Waar ben ik?