From 4e53de75df386c0c813a6605b2f9ad6b64afac55 Mon Sep 17 00:00:00 2001 From: Daniel Waters Date: Wed, 22 Apr 2015 16:27:52 +0100 Subject: [PATCH 1/2] tidying up jokes --- Dashing.conf/jobs/icndb.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dashing.conf/jobs/icndb.rb b/Dashing.conf/jobs/icndb.rb index 38427bc..591638d 100644 --- a/Dashing.conf/jobs/icndb.rb +++ b/Dashing.conf/jobs/icndb.rb @@ -14,7 +14,7 @@ # Convert to JSON and save joke j = JSON[response.body] - @@joke = j['value']['joke'] + @@joke = j['value']['joke'].gsub('Chuck Norris', 'Usman') @@ -22,4 +22,4 @@ SCHEDULER.every '10s', :first_in => 0 do |job| send_event('motd', { message: "#{@@joke}", origin: 'auto' }) -end \ No newline at end of file +end From 6231f806ffba60434cf883b625a57d0348ac9ceb Mon Sep 17 00:00:00 2001 From: Daniel Waters Date: Mon, 27 Apr 2015 10:34:33 +0100 Subject: [PATCH 2/2] Using api to correct name --- Dashing.conf/jobs/icndb.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dashing.conf/jobs/icndb.rb b/Dashing.conf/jobs/icndb.rb index 591638d..646c378 100644 --- a/Dashing.conf/jobs/icndb.rb +++ b/Dashing.conf/jobs/icndb.rb @@ -6,7 +6,7 @@ @@joke SCHEDULER.every '24h', :first_in => 0 do |job| - url = URI.parse("#{server}/jokes/random?limitTo=[nerdy]") + url = URI.parse("#{server}/jokes/random?limitTo=[nerdy]&firstName=Usman&lastName=Iqbal") http = Net::HTTP.new(url.host, url.port) http.use_ssl = (url.scheme == 'https') http.verify_mode = OpenSSL::SSL::VERIFY_NONE @@ -14,7 +14,7 @@ # Convert to JSON and save joke j = JSON[response.body] - @@joke = j['value']['joke'].gsub('Chuck Norris', 'Usman') + @@joke = j['value']['joke']