瀏覽代碼

added baths

master
Dunja Djokic 4 年之前
父節點
當前提交
24427f5be1
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. 6
    0
      app.js

+ 6
- 0
app.js 查看文件

@@ -129,6 +129,7 @@ app.post("/scrapes/", async (req, res) => {
const beds = req.body.beds;
const type = req.body.type;
const lifestyle = req.body.lifestyle;
const baths = req.body.baths;

// query builder
var query = `https://www.apartments.com`;
@@ -143,6 +144,10 @@ app.post("/scrapes/", async (req, res) => {
query += `/${beds}-bedrooms`;
}

if (baths) {
query += `${beds ? '-' : '/'}${baths}-bathrooms`;
}

if (price) {
if (beds) {
query += `-over-${price}`;
@@ -190,6 +195,7 @@ app.post("/scrapes/", async (req, res) => {
location: location,
description: description,
filters: [
{ name: 'baths', value: baths },
{ name: 'price', value: price },
{ name: 'beds', value: beds },
{ name: 'type', value: type },

Loading…
取消
儲存