Skip to content

Instantly share code, notes, and snippets.

@vanakenm
Created December 27, 2017 14:24
Show Gist options
  • Save vanakenm/52f6847c5348af53634e501649814db0 to your computer and use it in GitHub Desktop.
Save vanakenm/52f6847c5348af53634e501649814db0 to your computer and use it in GitHub Desktop.
def autocomplete
require "google/cloud/vision"
vision = Google::Cloud::Vision.new(project_id: "effin-bot")
image = vision.image(url)
text = image.text.to_s
text = text.gsub("\n", " ").downcase
self.contents = text
save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment