Giter Club home page Giter Club logo

neue_wohnung's Introduction

neue_wohnung

This is an application that scrapes apartment offers from websites of Wohnungsbaugesellschaften and Wohnungsgenossenschaften in Berlin and sends notifications about them.

Installation in development

  1. Install Ruby - use version from .ruby-version file
  2. Install PostgreSQL
  3. bundle install
  4. rails db:setup
  5. rails console to test that it runs

Telegram

You need to create your own Telegram bot and group to run the test suite and send notifications in production.

  1. Create the Telegram bot as described here. This will give you TELEGRAM_TOKEN.
  2. Create a new Telegram group and invite to it your bot and @GroupIDbot.
  3. Send /id message in the group and the bot will give you the chat ID of the group. This is TELEGRAM_CHAT_ID.

Testing

TELEGRAM_TOKEN=your_token TELEGRAM_CHAT_ID=your_chat_id rails spec

Apart from all tests passing, a test message should appear in your Telegram group.

Deployment to production

The application is deployed to Heroku. The deployment happens automatically after each push to the main branch.

If you'd like to deploy the application on your own - to Heroku or another platform - here are the few things to pay attention to:

  1. Set the environment variable TELEGRAM_TOKEN (Config Vars in Heroku)
  2. The application has no own user interface at the moment. Telegram serves the role of the user interface. The entry point to the application is the Rake task that checks for offers.
  3. You need to run the Rake task regularly - rails apartments:get_new. On Heroku you can use Heroku Scheduler addon for that. On your own server this may be a Cron job.
  4. Create at least one receiver. The receiver defines to which Telegram group the notifications go and which filters need to be applied:
rails console

or:

heroku console

and then:

Receiver.create!(
  name: "just a label",
  telegram_chat_id: "your_chat_id",
  include_wbs: true,
  minimum_rooms_number: 1,
  maximum_rooms_number: 10
)

neue_wohnung's People

Contributors

adamniedzielski avatar joerg-seitz avatar dependabot[bot] 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.