Apartament searching assistant for finn.no
I recently moved to Norway, and I needed a small tool to help me keep track of apartments for rent on finn.no. Basically - you enter a finnkode, it scrapes all the insertion's info from finn.no and imports it. After that, you can rate apartments, add comments and schedule appointments based on the insertions you've imported.
This is a standard rails3 app, so the usual bootstrapping process applies: modify your config/database.yml to point to your database instance, rake db:migrate and rails server should then start the app.
PostgreSQL is the default for production (I included the pg gem in the gemfile) but you can change it to whatever you want to - there are no hard dependencies, just change the adapter in the gemfile and you're good to go.
If you want to see the maps, you should also add a valid Google API key with Maps activated in the config/config.yml file.
There is no point and click user management available. To create users, run rake myfinn:admin for an admin or rake myfinn:user for a standard user, with the following parameters:
name: the actual user's name email: the email that will be used for access password: the user's password (at least 8 chars long)
for example:
rake myfinn:admin name=andrea email=andrea@test.com password=mytestpass
creates an user with admin privileges named 'andrea' with login email 'andrea@test.com' and password 'testpass'.
You can connect to
myfinn.herokuapp.com
to see a live demo. To access the demo site:
As an admin user: email - admin@myfinn.com, password - adminpass
As a normal user: email - user@myfinn.com, password - userpass
It is possible also to specify a filter and auto-import all the matching results for later screening. In the config.yml file, you can set the insertion_filter_url parameter to the URL corresponding to a given filter created on finn.no (complete with the domain name). If you do, you can then call the rake task myfinn:poll to run the job collecting all the new insertions matching the filter. You can then automate the polling by, for example, creating a cron job running that rake task. Example (search, every hour, for all new insertion with a monthly cost inferior to 17000 NOK/month):
-
Set the insertion_filter_url parameter in config.yml to http://www.finn.no/finn/realestate/lettings/result?PRICE_FROM=&sort=1&ESTATE_SIZE/LIVING_AREA_FROM=75&areaId=20061&PRICE_TO=17000
-
Set up a cron job by creating a bash script calling the rake job (bundle exec rake myfinn:poll) and placing it into the /etc/cron.hourly folder
That's it - the new insertions will be displayed in the appropriate section and you can then move them to the apartment section and rate them, set appointments and so on.
If you own a Twilio account you can also get an SMS notification when the watcher process finds new insertions. For that, you will need to set the appropriate informations on your config.yml file, as explained there, and call the rake task myfinn:notify. Like with the watcher process, you can automate the job using cron or another scheduler.
Well, first of all - good luck. The housing market's pretty tough in Norway at the moment, especially in Oslo.
If you take a look at the source, you'll see that it is in bad shape. I basically pasted this together in a day or two and then kept adding stuff when I felt the need to have it. No tests - at all - inline styles, inline JS.
So, if you're a rails programmer and feel like cleaning this mess up, you're most welcome :)