From b45a90f5c36423987f29c68db444420cbdd8c93e Mon Sep 17 00:00:00 2001 From: Simon Szustkowski Date: Thu, 11 Oct 2012 16:00:18 +0200 Subject: [PATCH] Twittert jetzt auch --- bot.rb | 9 ++++----- config.yaml | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bot.rb b/bot.rb index 653f535..a5acf0b 100755 --- a/bot.rb +++ b/bot.rb @@ -33,17 +33,16 @@ $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") - puts "Der Raum ist jetzt OFFLINE." + tweet = "Der Raum ist jetzt OFFLINE." status = "offline" elsif ($current_status == "online") - puts "Der Raum ist jetzt ONLINE." + tweet = "Der Raum ist jetzt ONLINE." status = "online" else - puts "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) } -else - puts "Raumstatus unveraendert" end \ No newline at end of file diff --git a/config.yaml b/config.yaml index 411802c..1bd9354 100644 --- a/config.yaml +++ b/config.yaml @@ -5,4 +5,4 @@ oauth: request_token: request_secret: worker: - last_status: offline + last_status: online