Class: WhosDatedWho::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/whos_dated_who/client.rb

Instance Method Summary collapse

Instance Method Details

#fetch(name) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/whos_dated_who/client.rb', line 3

def fetch(name)
  search = "#{name} dating site:whosdatedwho.com"
  bing_results = BingClient.new.search(search)
  url = bing_results.first[:Web].first[:Url]

  resp = Faraday.get(url)

  if resp.success?
    Parser.new.parse(resp.body)
  end
end