Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
5,763 additions
and
4,758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ docs/ | |
.env | ||
.coveralls.yml | ||
.nyc_output | ||
/dist | ||
/coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
language: node_js | ||
node_js: | ||
- '10' | ||
- '9' | ||
- '8' | ||
- '7' | ||
- '6' | ||
- '4' | ||
- "10" | ||
- "9" | ||
- "8" | ||
- "7" | ||
- "6" | ||
install: | ||
- yarn install | ||
script: | ||
- npm run test:ci | ||
after_success: npm run coverage | ||
- yarn lint | ||
- yarn build | ||
- yarn test | ||
after_success: | ||
- yarn coverage | ||
cache: | ||
yarn: true | ||
directories: | ||
- node_modules | ||
env: | ||
global: | ||
secure: kUspbZ9NL409PfkuIe5XVWPLdg8uq2T6VYzgv6pqhGhwKWt8iHqu3OP0TK2EJiROGo1CFDK1qZFedA4R9mQyQVV2vLi2t/+Qvi3xAtZlD+hRvn8lNNOexAxcL+oesjy3KMbXeRuEZI34HCrk3oLRBL6nPpLMnloooGinkXhITdY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,55 @@ | ||
// Call with ZWSID=<ZWSID> node examples.js GetZestimate | ||
var Zillow = require('../lib/node-zillow') | ||
var _ = require('lodash') | ||
var params = require('./parameters') | ||
var apiNames = _.keys(require('../lib/api-list')) | ||
var inspect = require('eyes').inspector({maxLength: 50000}) | ||
var Zillow = require("../lib/node-zillow"); | ||
var _ = require("lodash"); | ||
var params = require("./parameters"); | ||
var apiNames = _.keys(require("../lib/api-list")); | ||
var inspect = require("eyes").inspector({ maxLength: 50000 }); | ||
|
||
// Make sure we have specified the correct API name in the arguments | ||
var apiName = process.argv[2] | ||
if (!_.includes(apiNames, apiName)) throw new Error('requires apiName: \n' + apiNames.join(', ')) | ||
|
||
var apiName = process.argv[2]; | ||
if (!_.includes(apiNames, apiName)) | ||
throw new Error("requires apiName: \n" + apiNames.join(", ")); | ||
|
||
// Instantiate a zillow object by passing in our own custom Zillow id (zswid): | ||
var zwsid = process.env.ZWSID | ||
var zillow = new Zillow(zwsid) | ||
|
||
var zwsid = process.env.ZWSID; | ||
var zillow = new Zillow(zwsid); | ||
|
||
// Call parameters based on which API we are calling | ||
var parameters = (function() { | ||
switch (apiName) { | ||
case 'GetDeepSearchResults': return params.addressWithupdates; | ||
case 'GetUpdatedPropertyDetails': return params.zpidWithUpdates; | ||
case 'GetDeepComps': return _.extend(params.zpidWithComps, {count: 5}); | ||
case 'GetRateSummary': return {state: 'CO'}; | ||
case 'GetMonthlyPayments': return {price: 200000}; | ||
case 'GetDemographics': return params.zip; | ||
case 'GetRegionChildren': return {state: 'CO'}; | ||
case 'GetRegionChart': return params.chart; | ||
case 'GetSearchResults': return params.addressWithupdates; | ||
case 'GetZestimate': return params.zpidWithZestimate; | ||
case 'GetChart': return _.extend(params.chart, params.zpidWithZestimate); | ||
case 'GetComps': return _.extend(params.zpidWithComps, {count: 5}); | ||
case "GetDeepSearchResults": | ||
return params.addressWithupdates; | ||
case "GetUpdatedPropertyDetails": | ||
return params.zpidWithUpdates; | ||
case "GetDeepComps": | ||
return _.extend(params.zpidWithComps, { count: 5 }); | ||
case "GetRateSummary": | ||
return { state: "CO" }; | ||
case "GetMonthlyPayments": | ||
return { price: 200000 }; | ||
case "GetDemographics": | ||
return params.zip; | ||
case "GetRegionChildren": | ||
return { state: "CO" }; | ||
case "GetRegionChart": | ||
return params.chart; | ||
case "GetSearchResults": | ||
return params.addressWithupdates; | ||
case "GetZestimate": | ||
return params.zpidWithZestimate; | ||
case "GetChart": | ||
return _.extend(params.chart, params.zpidWithZestimate); | ||
case "GetComps": | ||
return _.extend(params.zpidWithComps, { count: 5 }); | ||
default: | ||
throw new Error(); | ||
} | ||
})() | ||
|
||
})(); | ||
|
||
// Call the primary API function based on the arguments passed in | ||
var example = zillow.get(apiName, parameters) | ||
var example = zillow.get(apiName, parameters); | ||
|
||
example.then(function(data) { | ||
inspect(data) | ||
return data; | ||
}) | ||
|
||
|
||
inspect(data); | ||
return data; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
module.exports = { | ||
zip: { zip: 80301 }, | ||
|
||
zip: {zip: 80301}, | ||
zpidWithZestimate: { zpid: 111111 }, | ||
|
||
zpidWithZestimate: {zpid: 111111}, | ||
|
||
zpidWithComps: {zpid: 13177031}, | ||
zpidWithComps: { zpid: 13177031 }, | ||
|
||
// House with data for the 'GetUpdatedPropertyDetails' API. Will generate a 502 error | ||
zpidWithUpdates: {zpid: 13176378}, | ||
zpidWithUpdates: { zpid: 13176378 }, | ||
|
||
addressWithupdates: { | ||
address: "2512 Mapleton Ave.", | ||
// citystatezip: 'Boulder, CO' // Can be city + state, or zip, or both | ||
citystatezip: '80304' | ||
citystatezip: "80304" | ||
}, | ||
|
||
// House without data for the 'GetUpdatedPropertyDetails' API. Will generate a 502 error | ||
zpidWithoutUpdates: {zpid: 13177031}, | ||
zpidWithoutUpdates: { zpid: 13177031 }, | ||
|
||
addressWithoutUpdates: { | ||
address: "1619 Pine St.", | ||
citystatezip: '80301' | ||
citystatezip: "80301" | ||
}, | ||
|
||
chart: {'unit-type': 'percent', width: 400, height: 300}, | ||
|
||
} | ||
chart: { "unit-type": "percent", width: 400, height: 300 } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import nodeZillow from "./lib/node-zillow"; | ||
export default nodeZillow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.