Skip to content

Commit

Permalink
Stop broken deals for the time being
Browse files Browse the repository at this point in the history
  • Loading branch information
Nachtalb committed Sep 12, 2023
1 parent 54a9070 commit f42c4b9
Show file tree
Hide file tree
Showing 5 changed files with 1,360 additions and 31 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ git clone https://github.com/Nachtalb/day-deals
cd day-deals

# Install dependencies
pip install -r requirements.txt
poetry install

# Copy sample config and adjust values inside
cp config.sample.json config.json
Expand All @@ -45,7 +45,7 @@ client such as [64gram][64gram] (desktop), [Plus][plus] or via another bot like
Just run the bot:

```bash
python day.py
poetry run python day.py
```

To run it periodically you can easily create a cronjob:
Expand Down
18 changes: 9 additions & 9 deletions day.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,18 @@ async def brack_data(raw, day, url):
current_id = current_sale_since.strftime("%d%m%Y")

info = {
"name": html.find(class_="product-description__title1").text,
"name": html.find(class_="ProductMain-Title").text,
"brand": "",
"id": current_id,
"rating": -1,
"rating_top": -1,
"description": html.find(class_="product-description__title2").text,
"image": html.find(class_="product-tabs__img").attrs["src"],
"price_before": float(re.search(r"\d+(\.\d+)?", html.find(class_="js-old-price").text).group()),
"price_after": float(re.search(r"\d+(\.\d+)?", html.find(class_="js-deal-price").text).group()),
"description": html.find(class_="ProductMain-Subtitle").text,
"image": html.find(class_="ProductMain-Image").attrs["src"],
"price_before": float(re.search(r"\d+(\.\d+)?", html.find(class_="Price-OldPriceValue").text).group()),
"price_after": float(re.search(r"\d+(\.\d+)?", html.find(class_="Price-Price").text).group()),
"quantity_total": -1,
"quantity_sold": -1,
"percent_available": int(re.sub(r"\D", "", html.find(class_="product-progress__availability").text)),
"percent_available": int(re.sub(r"\D", "", html.find(class_="ProgressBar-TextValue").text)),
"portal": portal,
"url": url,
"currency": "CHF",
Expand Down Expand Up @@ -400,9 +400,9 @@ async def main():
tasks = [
digitec(session),
brack(session),
brack(session, day=False), # Wochenangebot
twenty_min(session),
twenty_min(session, day=False), # Wochenangebot
# brack(session, day=False), # Wochenangebot
# twenty_min(session),
# twenty_min(session, day=False), # Wochenangebot
]

senders = []
Expand Down
Loading

0 comments on commit f42c4b9

Please sign in to comment.