Class: FineAnts::Adapters::Zillow
- Inherits:
-
Object
- Object
- FineAnts::Adapters::Zillow
- Defined in:
- lib/fine_ants/adapters/zillow.rb
Instance Method Summary collapse
- #download ⇒ Object
-
#initialize(credentials) ⇒ Zillow
constructor
A new instance of Zillow.
- #login ⇒ Object
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
#download ⇒ Object
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 |
#login ⇒ Object
10 11 12 |
# File 'lib/fine_ants/adapters/zillow.rb', line 10 def login return true # No login necessary end |