-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added web interface for Flathunter #6
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6 +/- ##
==========================================
+ Coverage 59.15% 64.87% +5.72%
==========================================
Files 7 11 +4
Lines 426 541 +115
Branches 50 62 +12
==========================================
+ Hits 252 351 +99
- Misses 159 170 +11
- Partials 15 20 +5
Continue to review full report at Codecov.
|
Reproduce the error:
log snippet:
my # Should the bot endlessly looop through the URLs?
# Between each loop it waits for <sleeping_time> seconds.
loop:
active: yes
sleeping_time: 5
# List the URLs containing your filter properties below.
# Currently supported services: www.immobilienscout24.de and
# www.wg-gesucht.de. List the URLs in the following format:
# urls:
# - https://www.immobilienscout24.de/Suche/...
# - https://www.wg-gesucht.de/...
urls:
# - https://www.wg-gesucht.de/wohnungen-in-Munchen.90.2.1.0.html?offer_filter=1&city_id=90&sort_column=0&noDeact=1&categories%5B%5D=2&rent_types%5B%5D=2&sMin=45&rMax=1100&rmMin=2&sin=1&exc=2&img_only=1
# - https://www.ebay-kleinanzeigen.de/s-wohnung-mieten/muenchen/anbieter:privat/anzeige:angebote/preis:800:1000/c203l6411+wohnung_mieten.etage_i:1,+wohnung_mieten.qm_d:45,+wohnung_mieten.zimmer_d:2,
- https://www.immobilienscout24.de/Suche/de/bayern/muenchen/wohnung-mieten?haspromotion=false&numberofrooms=2.0-&price=800.0-1000.0&livingspace=45.0-&floor=1-&sorting=2&enteredFrom=result_list
# - https://www.immowelt.de/liste/muenchen/wohnungen/mieten?roomi=2&prima=1000&wflmi=45&eqid=-205%2C-26&sort=createdate%2Bdesc
excluded_titles:
- "wg"
- "tausch"
- "wochenendheimfahrer"
- "pendler"
- "zwischenmiete"
# If an expose includes an address, the bot is capable of
# displaying the distance and time to travel (duration) to
# some configured other addresses, for specific kinds of
# travel.
#
# Available kinds of travel ('gm_id') can be found in the
# Google Maps API documentation, but basically there are:
# - "bicyle"
# - "transit" (public transport)
# - "driving"
#
# The example configuration below includes a place for
# "John", located at the main train station of munich.
# Two kinds of travel (bicycle and transit) are requested,
# each with a different label. Furthermore a place for
# "Jane" is included, located at the given destination and
# with the same kinds of travel.
durations:
- name: Hauptbahnhof
destination: Hauptbahnhof, München
modes:
- gm_id: transit
title: "Öff."
# Multiline message (yes, the | is supposed to be there),
# to format the message received from the Telegram bot.
#
# Available placeholders:
# - {title}: The title of the expose
# - {rooms}: Number of rooms
# - {price}: Price for the flat
# - {durations}: Durations calculated by GMaps, see above
# - {url}: URL to the expose
message: |
{title}
Zimmer: {rooms}
Größe: {size}
Preis: {price}
Ort: {address}
{url}
# Calculating durations requires access to the Google Maps API.
# 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).
google_maps_api:
key: DEDUCT
url: https://maps.googleapis.com/maps/api/distancematrix/json?origins={origin}&destinations={dest}&mode={mode}&sensor=true&key={key}&arrival_time={arrival}
enable: False
# Sending messages using Telegram requires a Telegram Bot configured.
# 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
# started a conversation with your bot.
#
# telegram:
# bot_token: 160165XXXXXXX....
# receiver_ids:
# - 12345....
# - 67890....
telegram:
bot_token: DEDUCT
receiver_ids:
- DEDUCT |
Added Favicon, Index page, basic CSS
Moved web interface to flathunter.web module Added initial test case Updated README.md
Refactored classes to make it possible to run the hunter through flask Added optional Connection argument to IdMaintainer methods to deal with threading
Display information on status page
Make Config object implement __iter__
f6f49cd
to
a22838a
Compare
The test suite was passing a dictionary instead of a Config object to hunter, which is why it didn't detect the issue. I've added a fix for that, and a fix for the issue now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Created a simple flask-based web interface that allows users to see time of last run, and to trigger a run.
The interface can be run locally, or deployed to Google Cloud