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 25 26 27 28 |
# 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_first( ".estimates .home-summary-row:nth-child(2) span:nth-child(2)", ".zestimate.primary-quote" ).text.match(/(\$.*)/)[1] [{ adapter: :zillow, user: @user, id: @user, name: find_first(".addr h1", ".hdp-home-header-st-addr").text, amount: BigDecimal(zestimate.gsub(/[\$,]/, "")) }] end |
#login ⇒ Object
10 11 12 |
# File 'lib/fine_ants/adapters/zillow.rb', line 10 def login true # No login necessary end |