From 471c70cec182027a77af0ecd0b2a9190d326d1e9 Mon Sep 17 00:00:00 2001 From: Simon Szustkowski Date: Mon, 22 Apr 2013 13:39:22 +0200 Subject: [PATCH] Wiederhergestellt --- bot.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bot.rb b/bot.rb index 33b64a7..a68f926 100755 --- a/bot.rb +++ b/bot.rb @@ -33,16 +33,20 @@ $current_status = res.body.to_s.strip # If status differs from last time checked, put the announcement if (last_status != $current_status) if ($current_status == "offline") - tweet = "Der Raum ist jetzt geschlossen." + tweet = "Der Raum ist jetzt GESCHLOSSEN. #ctdo" status = "offline" elsif ($current_status == "online") - tweet = "Der Raum ist jetzt offen." + tweet = "Der Raum ist jetzt OFFEN. #ctdo." status = "online" else - tweet = "Raumstatus unbekannt." + tweet = "Raumstatus UNBEKANNT." status = "unknown" end - client.update(tweet) $config['worker']['last_status'] = status File.open(CONFIG_FILE, 'w') { |f| YAML.dump($config, f) } + begin + client.update(tweet, {:lat => "51.527611", :lon => "7.464944", :display_coordinates => "true"}) + rescue + # Nothing to do here + end end