Class: FineAnts::Adapters::Zillow

Inherits:
Object
  • Object
show all
Defined in:
lib/fine_ants/adapters/zillow.rb

Instance Method Summary collapse

Constructor Details

#initialize(credentials) ⇒ Zillow

Returns a new instance of Zillow.



6
7
8
# File 'lib/fine_ants/adapters/zillow.rb', line 6

def initialize(credentials)
  @user = credentials[:user]
end

Instance Method Details

#downloadObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fine_ants/adapters/zillow.rb', line 14

def download
  visit "https://www.zillow.com/homedetails/total_nonsense/#{@user}_zpid/?fullpage=true"
  zestimate = find('.estimates .home-summary-row:nth-child(2) span:nth-child(2)').text
  [{
    :adapter => :zillow,
    :user => @user,
    :id => @user,
    :name => find('.addr h1').text,
    :amount => BigDecimal.new(zestimate.gsub(/[\$,]/,''))
  }]
end

#loginObject



10
11
12
# File 'lib/fine_ants/adapters/zillow.rb', line 10

def 
  return true # No login necessary
end