From e19f0b1f22178c26c6e811d97509d685d8f5c1fb Mon Sep 17 00:00:00 2001 From: Cool Fire Date: Wed, 25 Apr 2018 14:55:08 +0200 Subject: [PATCH] Use txt instead of json, since the json object does not seem to be updated anymore --- plugins/internetonfire.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/internetonfire.rb b/plugins/internetonfire.rb index 5d78f20..8642365 100644 --- a/plugins/internetonfire.rb +++ b/plugins/internetonfire.rb @@ -12,7 +12,7 @@ class Internetonfire @irc = irc @timer = timer - @url = 'https://istheinternetonfire.com/status.json' + @url = 'https://istheinternetonfire.com/status.txt' @timer = 3600 @recent = '' @@ -40,9 +40,7 @@ class Internetonfire def check_state loop do begin - response = open(@url).read - - state = JSON.parse(response)['status'] + state = open(@url).read # Check if changed since last time if @recent == state @@ -50,7 +48,7 @@ class Internetonfire else @recent = state # Set topic - @irc.topic( @channel, "#{@prefix} | Is the internet on fire? #{state}" ) + @irc.topic( @channel, "#{@prefix} | #{state}" ) end rescue Exception => e -- GitLab