suumo-search

Perform advanced searches on Suumo.jp
git clone https://git.neuralcrash.com/suumo-search.git
Log | Files | Refs | README

commit 7dc43cc92ca285662e126da68a3c387b461feefe
parent 36b9b50a2562214124c136243ae343e7d23907c4
Author: Kebigon <git@kebigon.xyz>
Date:   Fri, 13 Mar 2020 21:09:51 +0900

Add some basic documentation
Diffstat:
MREADME.md | 36++++++++++++++++++++++++++++++++++++
Msrc/main/java/xyz/kebigon/housesearch/domain/Posting.java | 4++--
Msrc/main/packaged-resources/cfg/search-conditions.cfg | 2+-
Msrc/main/packaged-resources/cfg/search-expression.cfg | 2+-
4 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md @@ -1,2 +1,37 @@ # suumo-search Perform advanced searches on Suumo.jp + +## Configuration + +### search-conditions.cfg + +| Property | Possible values | Description | +| -------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------- | +| area | see xyz.kebigon.housesearch.domain.Area | Location of the researched property | +| type | see xyz.kebigon.housesearch.domain.AnounceType | Type of the researched property | +| price.min | long | Minimum price of the property (in yens) : all postings cheaper will be ignored | +| price.max | long | Maximum price of the property (in yens) : all postings more expensive will be ignored | +| age.min | int | Minimum age of the property (in years) : all postings newer will be ignored | +| age.max | int | Maximum age of the property (in yens) : all postings older will be ignored | +| surface.land.min | int | Minimum surface of the property (in square meters) | +| surface.land.max | int | Maximum surface of the property (in square meters) | +| surface.house.min | int | Minimum surface of the house on the property (in square meters) | +| surface.house.max | int | Maximum surface of the house on the property (in square meters) | +| station.walktime.max | int | Maximum time to go to the nearest station by foot (in minutes) | +| expression.file | String | Name of a file containing a Spring Expression to filter the postings (see below) | + +### Spring expression file (defined by property expression.file of search-conditions.cfg) + +You can write an Spring expression to evaluate each postings that already successfully past the previous checks. To do so, you have access to the below functions + +| Function | Description | +| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| #timeToStation(#property, 'station name') | Returns the time in minutes to travel from the property to the mentioned station (based on the walk time to the nearest station from the posting, and the time between this station and the mentioned station). | +| #fareToStation(#property, 'station name') | Returns the price in yens to travel from the nearest station to the mentioned station. | +| #transferToStation(#property, 'station name') | Returns the number of transfers necessary to travel from the nearest station to the mentioned station. | + +NB: the station on the second argument must be written as found on Yahoo Transit. + +### log4j2.xml + +This file is used to configure how the application is managing its logs, see the log4j2 documentation +\ No newline at end of file diff --git a/src/main/java/xyz/kebigon/housesearch/domain/Posting.java b/src/main/java/xyz/kebigon/housesearch/domain/Posting.java @@ -21,12 +21,12 @@ public class Posting private final Integer age; /** - * Land surface (in squared meters) + * Land surface (in square meters) */ private final Double landSurface; /** - * House surface (in squared meters) + * House surface (in square meters) */ private final Double houseSurface; diff --git a/src/main/packaged-resources/cfg/search-conditions.cfg b/src/main/packaged-resources/cfg/search-conditions.cfg @@ -16,7 +16,7 @@ surface.house.min=80 surface.house.max= # Time to go to the nearest station by foot (in minutes) -station.walktime.max=15 +station.walktime.max= # More complex conditions in form of a spring expression expression.file=search-expression.cfg diff --git a/src/main/packaged-resources/cfg/search-expression.cfg b/src/main/packaged-resources/cfg/search-expression.cfg @@ -13,7 +13,7 @@ || (#timeToStation(#property, '三越前') <= 60 && #fareToStation(#property, '三越前') <= 500 && #transferToStation(#property, '三越前') <= 1) || (#timeToStation(#property, '大手町(東京都)駅') <= 60 && #fareToStation(#property, '大手町(東京都)駅') <= 500 && #transferToStation(#property, '大手町(東京都)駅') <= 1) - # Direct rotue + # Direct route || (#timeToStation(#property, '東京駅') <= 60 && #fareToStation(#property, '東京駅') <= 750 && #transferToStation(#property, '東京駅') == 0) || (#timeToStation(#property, '三越前') <= 60 && #fareToStation(#property, '三越前') <= 750 && #transferToStation(#property, '三越前') == 0)