Git Product home page Git Product logo

blocket-alert's Introduction

๐Ÿ”” Blocket alert

This repo contains the code of a Blocket scrapper that sends Slack messages whenever it find an ad that suits your needs, in real-time. The idea comes from this repo that does the same for Craigslist. The main advantages are :

  • ๐Ÿ•– It can send you a message directly when a new ad is added on Blocket, which can increase your chances to get a response from a landlord since you will be in the first persons contacting them. No need to check 3 times a day anymore.
  • ๐Ÿ‘ It can filter ads for you based on some criteria. Instead of filtering yourself everytime (price, location...) this program does it for you and don't alert you when an ad doesn't suit your needs.

This is how the messages looks like:

A screenshot of the aspect of the received messages

This scrapper only works with the renting part in the housing section of Blocket. The buying market or anything else are not a part of it. Feel free to submit a PR to include them as well!

๐Ÿ“ฌ Configuration

You can easily configure the scrapper with the fields present in the settings.py file. Here are the most important variable to look at when using this scrapper:

SEARCH_OPTIONS = {
    'minPrice' : 9000, # minimum price in SEK
    'maxPrice' : 12000, # maximum price in SEK
    'minRooms' : 1, # minimum number of rooms
    'maxRooms' : 3, # maximum number of rooms
    'minBedrooms' : 1, # minimum number of bedrooms
    'minSize' : 20, # minimum size in square meters
    'maxSize' : 80 # maximum size in square meters
}

CITY = "stockholm"

PREFERED_NEIGHBOORHOODS = [ ]

EXCLUDED_NEIGHBOORHOODS = [
   'Tรคby',
   'Sollentuna'
]

SLACK_CHANNEL = '@nicolas' # can also be a channel '#housing' for example

๐Ÿ’พ Installation

Slack Integration

  1. For the scrapper to post on Slack you need to create an "App" for Slack here and associate it to the team you want the scrapper to post on.
  2. Once you have created your app, go to the "Basic Information" tab and click on "Add features and functionality" and under "Permissions" add the "Send message as User" and "Send message as [App Name]" in the "Permission Scopes"
  3. Under the "OAuth & Permissions" tab copy the OAuth access Token to your clipboard.
  4. Set it in the appropriate environment variable export SLACK_API_TOKEN="Your OAuth token here"

Python requirements

  1. Install Python3 and Python3 pip
  2. Install all the Python3 necessary packages pip3 install -r requirements.txt
  3. Grant execution permission on the scrapper chmod +x scrapper.py
  4. Run it and your good to go ./scrapper.py

It is recommended to create a virtual environment using virtualenv for this.

Tips to launch the script

You can use forever to run this script.

forever start -c python3 ./scrapper.py

๐Ÿ“ˆ Todos

  1. Add other part of Blocket, not only the rentals

blocket-alert's People

Contributors

bridouille avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.