Twittert jetzt auch
This commit is contained in:
parent
af77c9b1a4
commit
b45a90f5c3
9
bot.rb
9
bot.rb
|
@ -33,17 +33,16 @@ $current_status = res.body.to_s.strip
|
||||||
# If status differs from last time checked, put the announcement
|
# If status differs from last time checked, put the announcement
|
||||||
if (last_status != $current_status)
|
if (last_status != $current_status)
|
||||||
if ($current_status == "offline")
|
if ($current_status == "offline")
|
||||||
puts "Der Raum ist jetzt OFFLINE."
|
tweet = "Der Raum ist jetzt OFFLINE."
|
||||||
status = "offline"
|
status = "offline"
|
||||||
elsif ($current_status == "online")
|
elsif ($current_status == "online")
|
||||||
puts "Der Raum ist jetzt ONLINE."
|
tweet = "Der Raum ist jetzt ONLINE."
|
||||||
status = "online"
|
status = "online"
|
||||||
else
|
else
|
||||||
puts "Raumstatus UNBEKANNT."
|
tweet = "Raumstatus UNBEKANNT."
|
||||||
status = "unknown"
|
status = "unknown"
|
||||||
end
|
end
|
||||||
|
client.update(tweet)
|
||||||
$config['worker']['last_status'] = status
|
$config['worker']['last_status'] = status
|
||||||
File.open(CONFIG_FILE, 'w') { |f| YAML.dump($config, f) }
|
File.open(CONFIG_FILE, 'w') { |f| YAML.dump($config, f) }
|
||||||
else
|
|
||||||
puts "Raumstatus unveraendert"
|
|
||||||
end
|
end
|
|
@ -5,4 +5,4 @@ oauth:
|
||||||
request_token:
|
request_token:
|
||||||
request_secret:
|
request_secret:
|
||||||
worker:
|
worker:
|
||||||
last_status: offline
|
last_status: online
|
||||||
|
|
Loading…
Reference in New Issue