Sha256: 87cd70f476bbe84db5127dfa9887aa0f0dfbd6a8961c7d5ce31c7a905194ab22

Contents?: true

Size: 378 Bytes

Versions: 3

Compression:

Stored size: 378 Bytes

Contents

module WhosDatedWho
  class Client
    def fetch(name)
      bing_results = BingClient.new.search("#{name} site:whosdatedwho.com")
      url = bing_results.first[:Web].first[:Url]
      resp = Faraday.get(url)
      if resp.success?
        Parser.new.parse(resp.body)
      end
    end

    private
    def normalize(name)
      name.gsub(/\s/, '-').downcase
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
whos_dated_who-0.1.1 lib/whos_dated_who/client.rb
whos_dated_who-0.1.0 lib/whos_dated_who/client.rb
whos_dated_who-0.0.1 lib/whos_dated_who/client.rb