Giter VIP home page Giter VIP logo

datenraten / fredy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from orangecoding/fredy

0.0 0.0 0.0 4.62 MB

:heart: Fredy - [F]ind [R]eal [E]states [D]amn Eas[y] - Fredy will constantly search for new listings on sites like Immoscout or Immowelt and send new results to you, so that you can focus on more important things in life ;)

Home Page: http://www.orange-coding.net

License: MIT License

JavaScript 89.77% HTML 0.24% Handlebars 7.98% Dockerfile 0.24% Less 1.77%

fredy's Introduction

sudo apt install nodejs
sudo apt install npm
sudo npm install --global yarn
git clone https://github.com/orangecoding/fredy .fredy
cd /home/datenraten/.fredy
yarn
yarn run prod
yarn run start
http://localhost:9998 in VCN
FULL CREDIT: https://blog.merzlabs.com/posts/js-autostart-systemd/

Replace <YOUR-NAME> with a name descriptive of your project. Make it memorable because you have to remember it to stop/restart your project or get the logs.

Replace PATH-TO-PROJECT with the path to your project (something like /home/user/todo-list). Be aware that you still have to use absolute paths to reference your npm executable.

Replace SCRIPT-NAME with the npm script you want to execute. This will probably be something like start or dev. These scripts are listed under the scripts property in your projects package.json.

    If you have not yet installed your npm packages then of course do this first. Go into your project folder and execute

    npm i

    Find out the current path to your npm executable with which. Small recommendation by me for all you macOS and Linux people: Use Node Version Manager (nvm). It works without problems with this, the resulting paths will just look a bit differently.

    which npm

    This will return a path in your file system, use this later as <YOUR-NPM-PATH>

    Create a service via:

    sudo systemctl --force --full edit <YOUR-NAME>.service

    And paste

    [Unit]
    Description=<(Optional) Description of your project>
    After=network.target

    [Service]
    WorkingDirectory=/home/user/<PATH-TO-PROJECT>
    ExecStart=<YOUR-NPM-PATH> run <SCRIPT-NAME>

    [Install]
    WantedBy=multi-user.target

    Save it and reload all Systemd services via

    sudo systemctl daemon-reload

    Enable autostart on boot of your new service:

    sudo systemctl enable <YOUR-NAME>.service

Build Status

Searching an apartment in Germany can be a frustrating task. Not any longer though, as Fredy will take over and will only notify you once new listings have been found that match your requirements.

Fredy scrapes multiple services (Immonet, Immowelt etc.) and send new listings to you once they become available. The list of available services can easily be extended. For your convenience, Fredy has a UI to help you configure your search jobs.

If Fredy finds matching results, it will send them to you via Slack, Email, Telegram etc. (More adapters can be configured.) As Fredy stores the listings it has found, new results will not be sent to you twice (and as a side-effect, Fredy can show some statistics). Furthermore, Fredy checks duplicates per scraping so that the same listings are not being sent twice or more when posted on various platforms (which happens more often than one might think).

Sponsorship

If you like my work, consider becoming a sponsor. I'm not expecting anybody to pay for Fredy or any other Open Source Project I'm maintaining, however keep in mind, I'm doing all of this in my spare time :) Thanks.

Fredy is supported by JetBrains under Open Source Support Program

Usage

  • Make sure to use Node.js 18 or above
  • Run the following commands:
yarn (or npm install)
yarn run prod
yarn run start

Fredy will start with the default port, set to 9998. You can access Fredy by opening your browser at http://localhost:9998. The default login is admin, both for username and password. You should change the password as soon as possible when you plan to run Fredy on a server.

Job Configuration         Job Analytics         Job Overview

Understanding the fundamentals

There are 3 important parts in Fredy, that you need to understand to leverage the full power of Fredy.

Provider

Fredy supports multiple services. Immonet, Immowelt and Ebay are just a few examples. Those services are called providers within Fredy. When creating a new job, you can choose one or more providers. A provider contains the URL that points to the search results for the respective service. If you go to immonet.de and search for something, the displayed URL in the browser is what the provider needs to do its magic. It is important that you order the search results by date, so that Fredy always picks the latest results first!

Adapter

Fredy supports multiple adapters, such as Slack, SendGrid, Telegram etc. A search job can have as many adapters as supported by Fredy. Each adapter needs different configuration values, which you have to provide when using them. A adapter dictactes how the frontend renders by telling the frontend what information it needs in order to send listings to the user.

Jobs

A Job wraps adapters and providers. Fredy runs the configured jobs in a specific interval (can be configured in /conf/config.json).

Creating your first job

To create your first job, click on the button "Create New Job" on the job table. The job creation dialog should be self-explanatory, however there is one important thing. When configuring providers, before copying the URL from your browser, make sure that you have sorted the results by date to make sure Fredy always picks the latest results first.

User management

As an administrator, you can create, edit and remove users from Fredy. Be careful, each job is connected to the user that has created the job. If you remove the user, their jobs will also be removed.

Development

Running Fredy in development mode

To run Fredy in development mode, you need to run the backend & frontend separately. Start the backend with:

yarn run start

For the frontend, run:

yarn run dev

You should now be able to access Fredy from your browser. Check your Terminal to see what port the frontend is running on.

Running Tests

To run the tests, run

yarn run test

Architecture

Architecture

Immoscout / Immonet

I have added experimental support for Immoscout and Immonet. They both are somewhat special, because they have decided to secure their service from bots using Re-Capture. Finding a way around this is barely possible. For Fredy to be able to bypass this check, I'm using a service called ScrapingAnt. The trick is to use a headless browser, rotating proxies and (once successfully validated) to re-send the cookies each time.

To be able to use Immoscout / Immonet, you need to create an account at ScrapingAnt. Configure the API key in the "General Settings" tab (visible when logged in as administrator). The rest will be handled by Fredy. Keep in mind, the support is experimental. There might be bugs and you might not always pass the re-capture check, but most of the time it works rather well :)

If you need more than the 1000 API calls allowed per month, I'd suggest opting for a paid account... ScrapingAnt loves OpenSource, therefore they have decided to give all Fredy users a 10% discount by using the code FREDY10 (Disclaimer: I do not earn any money for recommending their service).

Contribution guidelines

See Contributing

Docker

Use the Dockerfile in this repository to build an image.

Example: docker build -t fredy/fredy /path/to/your/Dockerfile

Or use docker-compose:

Example docker-compose build

Or use the container that will be built automatically.

docker pull ghcr.io/orangecoding/fredy:master

Create & run a container

Put your config.json into a path of your choice, such as /path/to/your/conf/.

Example: docker create --name fredy -v /path/to/your/conf/:/conf -p 9998:9998 fredy/fredy

Logs

You can browse the logs with docker logs fredy -f.

fredy's People

Contributors

orangecoding avatar datenraten avatar joschi avatar ah-it-sltn avatar carlambroselli avatar vanhekthor avatar noctarius avatar dalins avatar mefarazath avatar janekbettinger avatar sebastianwilczek avatar bergo avatar sven-simonsen avatar anbucher avatar jstnw10 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.