Add Rate Monitor app — Booking.com + direct booking engine competitor rates
Combines Booking.com Playwright scraper (from forecasting), direct booking engine scraper (ported from laptop-archive/guestline-monitor), and Newbook own-hotel rates into one focused tool. Four views: Bookability, Market View (with price index badges + direct rate sub-rows), Direct Rates (per-competitor room breakdown, min-stay flags, hotel config/discovery), Rate Analysis (advance purchase curve, DOW chart, rate timeline, comparison table). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
e05054172f
50 changed files with 11860 additions and 0 deletions
28
backend/services/direct_profiles/__init__.py
Normal file
28
backend/services/direct_profiles/__init__.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from .guestline import GuestlineProfile
|
||||
from .newbook_scrape import NewbookScrapeProfile
|
||||
from .travelclick import TravelClickProfile
|
||||
from .directbook import DirectBookProfile
|
||||
from .base import BaseProfile
|
||||
|
||||
PROFILES = {
|
||||
"guestline": GuestlineProfile,
|
||||
"newbook_scrape": NewbookScrapeProfile,
|
||||
"travelclick": TravelClickProfile,
|
||||
"directbook": DirectBookProfile,
|
||||
}
|
||||
|
||||
|
||||
def get_profile(name: str) -> BaseProfile:
|
||||
cls = PROFILES.get(name)
|
||||
if not cls:
|
||||
raise ValueError(f"Unknown engine profile: {name}")
|
||||
return cls()
|
||||
|
||||
|
||||
def detect_profile(url: str) -> dict | None:
|
||||
"""Given a booking URL, return suggested profile name and extracted params."""
|
||||
for name, cls in PROFILES.items():
|
||||
result = cls.detect(url)
|
||||
if result is not None:
|
||||
return {"profile": name, **result}
|
||||
return None
|
||||
Loading…
Add table
Add a link
Reference in a new issue