Commit e19f0b1f authored by Cool Fire's avatar Cool Fire

Use txt instead of json, since the json object does not seem to be updated anymore

parent afdfb285
Pipeline #612 passed with stages
in 3 minutes and 24 seconds
...@@ -12,7 +12,7 @@ class Internetonfire ...@@ -12,7 +12,7 @@ class Internetonfire
@irc = irc @irc = irc
@timer = timer @timer = timer
@url = 'https://istheinternetonfire.com/status.json' @url = 'https://istheinternetonfire.com/status.txt'
@timer = 3600 @timer = 3600
@recent = '' @recent = ''
...@@ -40,9 +40,7 @@ class Internetonfire ...@@ -40,9 +40,7 @@ class Internetonfire
def check_state def check_state
loop do loop do
begin begin
response = open(@url).read state = open(@url).read
state = JSON.parse(response)['status']
# Check if changed since last time # Check if changed since last time
if @recent == state if @recent == state
...@@ -50,7 +48,7 @@ class Internetonfire ...@@ -50,7 +48,7 @@ class Internetonfire
else else
@recent = state @recent = state
# Set topic # Set topic
@irc.topic( @channel, "#{@prefix} | Is the internet on fire? #{state}" ) @irc.topic( @channel, "#{@prefix} | #{state}" )
end end
rescue Exception => e rescue Exception => e
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment