Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Cool Fire
nanobot4
Commits
e19f0b1f
Commit
e19f0b1f
authored
Apr 25, 2018
by
Cool Fire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
plugins/internetonfire.rb
plugins/internetonfire.rb
+3
-5
No files found.
plugins/internetonfire.rb
View file @
e19f0b1f
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment