Skip to content

Commit

Permalink
Merge pull request #5 from cugu/readme
Browse files Browse the repository at this point in the history
Simplify README.md
  • Loading branch information
NodyHub authored Jan 4, 2020
2 parents ec68780 + 9db5755 commit 99d458b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 46 deletions.
50 changes: 7 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,23 @@
# Python Flathunter-Helper
# Flathunter
A python crawler which crawls Immobilienscout24.de and wg-gesucht.de for new appartments and sends the results to a Telegram user

[![Build Status](https://travis-ci.org/NodyHub/flathunter.svg?branch=master)](https://travis-ci.org/NodyHub/flathunter)

## Setup

### Virtual Environment (Optional)
To keep you python environment and site-packages clean, it is recommended
to run the project in a virtual environment. Install ```virtualenv```,
create a venv and activate.
```
$ pip install virtualenv
$ virtualenv -p /usr/bin/python3.6 venv
$ source venv/bin/activate
```


### Requirements
Install requirements from ```requirements.txt``` to run execute flathunter properly.
Install requirements from ```requirements.txt``` to run execute flathunter properly:
```
pip install -r requirements.txt
```

## Usage
```
usage: flathunter.py [-h] [--config CONFIG]
Searches for flats on Immobilienscout24.de and wg-gesucht.de and sends results
to Telegram User
optional arguments:
-h, --help show this help message and exit
--config CONFIG, -c CONFIG
Config file to use. If not set, try to use
'~git-clone-dir/config.yaml'
```

### Configuration
Rename ```config.yaml.dist``` to ```config.yaml``` and go through it to adapt it to your needs.

#### Bot registration
A new bot can registered with the telegram chat with the [BotFather](https://telegram.me/BotFather).

#### Chat-Ids
To get the chat id, the [REST-Api](https://core.telegram.org/bots/api) of telegram can be used to fetch the received messages of the Bot.
## Usage
To use the flathunter simply run:
```
$ curl https://api.telegram.org/bot[BOT-TOKEN]/getUpdates
python flathunter.py
```

#### Google API
To use the distance calculation feature a [Google API-Key](https://developers.google.com/maps/documentation/javascript/get-api-key) is needed.


## Contributers
- [@NodyHub](https://github.com/NodyHub)
- Bene
- [@Cugu](https://github.com/Cugu)


13 changes: 10 additions & 3 deletions config.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,23 @@ message: |
# Below you can configure the URL to access the API, with placeholders.
# The URL should most probably just kept like that.
# To use the Google Maps API, an API key is required. You can obtain one
# without costs from the Google App Console (just google for it).
# without costs from the Google App Console
# (https://developers.google.com/maps/documentation/javascript/get-api-key).
google_maps_api:
key: YOUR_API_KEY
url: https://maps.googleapis.com/maps/api/distancematrix/json?origins={origin}&destinations={dest}&mode={mode}&sensor=true&key={key}&arrival_time={arrival}

# Sending messages using Telegram requires a Telegram Bot configured.
# A new bot can registered with the telegram chat with the BotFather
# (https://telegram.me/BotFather).
# Telegram.org offers a good documentation about how to create a bot.
# Once you read it, will make sense. Still: bot_token should hold the
# access token of your bot and receiver_ids should list the client ids
# of receivers. Note that those receivers are required to already have
# access token of your bot and receiver_ids (= chat_ids) should list
# the chat ids of receivers. To get the chat id, the REST-Api
# (https://core.telegram.org/bots/api) of telegram can be used to
# fetch the received messages of the Bot (e.g. curl
# https://api.telegram.org/bot[BOT-TOKEN]/getUpdates).
# Note that those receivers are required to already have
# started a conversation with your bot.
# The token can be fetched over the API. At first, you need to send a
# message to the Bot and afterwards, the event can be fetched by the
Expand Down

0 comments on commit 99d458b

Please sign in to comment.