Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dashing.conf/jobs/icndb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

# Convert to JSON and save joke
j = JSON[response.body]
@@joke = j['value']['joke']
@@joke = j['value']['joke'].gsub('Chuck Norris', 'Usman')
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 😄
There is however a way to do this via the icndb API - have a look at: http://www.icndb.com/api/ (look for "Changing the name of the main character"), which I think would be nicer!

EDIT: Also, I've just thought... would be nice to make this an environment variable to make it easy to change (otherwise you have to mess with the code and build the container again, which is a faff)




end

SCHEDULER.every '10s', :first_in => 0 do |job|
send_event('motd', { message: "#{@@joke}", origin: 'auto' })
end
end