SS.COM Parser is a simple RSS feed parser of the advertising site https://ss.com/ written in Java and Spring Boot. It uses Docker as primary execution environment and Gradle build tool for building application image.
For a quick start, use the following instructions
git clone https://github.com/AlekseyChudov/ss-parser.git
cd ss-parser
./gradlew jibDockerBuild
docker run -it --rm ss-parser:1.12
Congratulations! You have just compiled the SS.COM Parser Java application, packed it into the Docker image and ran the Docker container. You can now lean back and enjoy the logs :)
Spring Boot lets you customize configuration in a various ways. To customize Docker application configuration it is convenient to use environment variables. The properties supported by SS.COM Parser and Spring Boot with their default values are shown in application.yml and Appendix A, Common application properties respectively. SS.COM Parser uses Spring Expression Language (SpEL) as filter engine.
Create environment variables file ss-parser.env
. To avoid blocking, select the most common user agent. Do not forget to convert the values from yaml or properties format into environment variables format.
HTTP_AGENT=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
SPRING_MAIL_HOST=smtp.gmail.com
[email protected]
SPRING_MAIL_PASSWORD=secret
SS_PARSER_MAIL_ENABLED=true
[email protected]
[email protected]
SS_PARSER_CAR_ENABLED=true
SS_PARSER_CAR_EXPRESSION=mark == 'Lexus' and year >= 2016
SS_PARSER_FLAT_ENABLED=true
SS_PARSER_FLAT_EXPRESSION=region matches 'Плявниеки|Пурвциемс' and rooms > 3 and area > 100
SS_PARSER_HOME_ENABLED=true
SS_PARSER_HOME_EXPRESSION=region matches 'Дарзциемс|Плявниеки|Пурвциемс|Межциемс' and area > 200 and land > 600
Then run the Docker container with the new configuration file.
docker run -it --rm --env-file ss-parser.env ss-parser:1.12
Once you are satisfied with the filter and configuration, just run the Docker container in the background.
docker run -d --rm --env-file ss-parser.env ss-parser:1.12
If you are not familiar with Docker and containers, there are many tutorials like A Docker Tutorial for Beginners.