zillow_api 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zillow_api.rb +23 -11
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 983064ad60143a3331d18d29b430e514bbb4ed63
4
- data.tar.gz: e99b2335b22f55c229dc8d9cc401c3f3319a223f
3
+ metadata.gz: 32dd0ffc278371e2498f3331721402543c7c44f8
4
+ data.tar.gz: 7c314036fa7361244d5083e9aa4b61654573d2c1
5
5
  SHA512:
6
- metadata.gz: 0eb5b499a26d3719a5e52c78d7ba1f04a6ff61f704c809541b0c84a33d6037c85541d58701a4bf6c6c697e854a32eebffbc2028c172b81b7a977a394b16d6406
7
- data.tar.gz: c33aa0d8beb0a3fdb9298cd2670411649f09a977329347aa8ba22613d152180ccba796dfd75af95bf0ee460c59014fb81a9bbdba7d23c94c74666633cf648f24
6
+ metadata.gz: c32421e45a1199f96cd48a15bfc4bb21c1729043f4a30acfcbc672eb594d1831f1c721708a5bfea4f877f0c46e2479170b7dcf923fd7e2b92309a701e4b08588
7
+ data.tar.gz: f06a965409659cd5d90eb31301030c2def251741fffd9c2283901abf4339f372c4227868d45adbb730c08fb6897bff795ab0a3c2f4cadb33519a4873bbec86d5
data/lib/zillow_api.rb CHANGED
@@ -2,7 +2,7 @@ class ZillowAPI
2
2
  require 'open-uri'
3
3
  require 'nokogiri'
4
4
 
5
- ZILLOW_API_URL = "http://www.zillow.com/webservice/GetSearchResults.htm?rentzestimate=true"
5
+ ZILLOW_API_URL = "http://www.zillow.com/webservice/GetDeepSearchResults.htm?rentzestimate=true"
6
6
  ZILLOW_DEMO_URL = "http://www.zillow.com/webservice/GetDemographics.htm?"
7
7
  ZILLOW_API_ZPID_URL = "http://www.zillow.com/webservice/GetZestimate.htm?rentzestimate=true"
8
8
 
@@ -48,17 +48,29 @@ class ZillowAPI
48
48
  if property.css("zpid")[0].text.to_i.to_s == property.css("zpid")[0].text
49
49
  property_data = {}
50
50
  property_data = { zpid: property.css("zpid")[0].text,
51
- street: property.css("address")[1].children[0].text,
52
- zip_code: property.css("address")[1].children[1].text,
53
- city: property.css("address")[1].children[2].text.downcase,
54
- state: property.css("address")[1].children[3].text.downcase,
55
- latitude: property.css("address")[1].children[4].text,
56
- longitude: property.css("address")[1].children[5].text,
57
- zestimate: property.css("zestimate")[0].children[0].text,
58
- rent_zestimate: property.css("rentzestimate")[0].children[0].text,
59
- neighborhood_id: property.css("localrealestate")[0].children.css("region").first["id"],
51
+ street: property.css("address")[1].children[0].text,
52
+ zip_code: property.css("address")[1].children[1].text,
53
+ city: property.css("address")[1].children[2].text.downcase,
54
+ state: property.css("address")[1].children[3].text.downcase,
55
+ latitude: property.css("address")[1].children[4].text,
56
+ longitude: property.css("address")[1].children[5].text,
57
+ zestimate: property.css("zestimate")[0].children[0].text,
58
+ zestimate_low: property.css('valuationrange').children[0].text,
59
+ zestimate_high: property.css('valuationrange').children[1].text,
60
+ rent_zestimate: property.css("rentzestimate")[0].children[0].text,
61
+ neighborhood_id: property.css("localrealestate")[0].children.css("region").first["id"],
60
62
  neighborhood_name: property.css("localrealestate")[0].children.css("region").first["name"],
61
- neighborhood_type: property.css("localrealestate")[0].children.css("region").first["type"]
63
+ neighborhood_type: property.css("localrealestate")[0].children.css("region").first["type"],
64
+ zillow_address: property.css('homedetails')[0].text,
65
+ house_type: property.css('usecode').text,
66
+ property_tax: property.css('taxassessment').text,
67
+ year_built: property.css('yearbuilt').text,
68
+ lot_size: property.css('lotsizesqft').text,
69
+ house_size: property.css('finishedsqft').text,
70
+ bathrooms: property.css('bathrooms').text,
71
+ bedrooms: property.css('bedrooms').text,
72
+ last_sold_date: property.css('lastsolddate').text,
73
+ last_sold_price: property.css('lastsoldprice').text
62
74
  }
63
75
  return property_data
64
76
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zillow_api
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Freeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-28 00:00:00.000000000 Z
11
+ date: 2015-10-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Gem for interfacing with Zillow API
14
14
  email: benfreeman@gmail.com