-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove extensions and install script in favor of homebrew
- Loading branch information
Showing
3 changed files
with
37 additions
and
61 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file was deleted.
Oops, something went wrong.