Sha256: fdab34c1d5eb9772465b08196bd8e1224a66c6fd9f2ff891664488f6063d3581

Contents?: true

Size: 313 Bytes

Versions: 3

Compression:

Stored size: 313 Bytes

Contents

require "related_word/version"
require "json"
require "net/http"
require "uri"

module RelatedWord
  LINK = "http://semantic-link.com/related.php?word="

  def self.find(word)
    link = "#{LINK}#{word}"
    uri = URI.parse(link)
    response = Net::HTTP.get_response(uri)
    JSON.parse(response.body)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
related_word-0.1.5 lib/related_word.rb
related_word-0.1.4 lib/related_word.rb
related_word-0.1.3 lib/related_word.rb