Created
November 30, 2011 03:32
-
-
Save gbissett/1407870 to your computer and use it in GitHub Desktop.
curry notice
This file contains hidden or 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
require 'rtesseract' | |
def get_image | |
system 'curl -s -o image.jpg http://akueats.com/_library/images/cococurry-sign.jpg' | |
system 'convert image.jpg -type Grayscale image.tif' | |
end | |
def image_contains_curry | |
return true if RTesseract.new('image.tif').to_s.downcase.include? 'curry' | |
false | |
end | |
def today_is_wednesday | |
Time.now.wednesday? | |
end | |
def become_excited_or_sad | |
if today_is_wednesday and image_contains_curry | |
puts "CURRY DAY!!!!" | |
else | |
puts "no curry :(" | |
end | |
end | |
get_image | |
become_excited_or_sad |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment