Skip to content

Commit

Permalink
remove extensions and install script in favor of homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
bwagner5 committed Aug 2, 2018
1 parent 91afa73 commit 9054308
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 61 deletions.
38 changes: 0 additions & 38 deletions install-say.sh

This file was deleted.

37 changes: 37 additions & 0 deletions say-quotes
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env ruby

require 'net/http'
require 'uri'
require 'json'

def say(message)
`say -v 'Samantha' --quality 127 #{message}`
end

def speak_quote()
uri = URI.parse("https://quotes.rest/qod")

response = Net::HTTP.get_response(uri)

if response.code == '200'
response_body = response.body
quote = JSON.parse(response_body)['contents']['quotes'][0]['quote']
say(quote)
sleep 2
say("Looks like you left your computer unlocked, uninstall with brew remove say-quotes")
end
end

if __FILE__==$0

if ARGV[0] == "--help"
puts "say-quotes will speak a quote every 24 hours from the time it was installed."
puts "If you don't know how this was installed, you most likely left your computer unlocked and a friendly co-worker decided to provide you with inspirational quotes :)"
puts "Never fear, if you need to uninstall, simply execute \"brew remove say-quotes\""
else
speak_quote
end

end


23 changes: 0 additions & 23 deletions say-quotes.rb

This file was deleted.

0 comments on commit 9054308

Please sign in to comment.