Commit Graph

34 Commits

Author SHA1 Message Date
Claude
30c9872d04 Add presence heartbeat to keep bot shown as online
Adds a background asyncio.Task that calls set_presence("online") every
60 seconds to keep the homeserver presence status fresh. On startup the
bot sets itself online and spawns the heartbeat; on shutdown the task is
cancelled and presence is set to offline before closing the client.

https://claude.ai/code/session_01Nu3N2okrfJV3meatEmYdrB
2026-02-28 08:14:46 +00:00
prosolis
123252e197 Merge pull request #12 from prosolis/claude/fix-isthereanydeal-api-W5umt
Fixed post formatting issues
2026-02-27 21:33:00 -08:00
Claude
c5ae8543e1 Fix Matrix formatting: build HTML directly instead of markdown conversion
The markdown library's conversion collapsed blockquote lines into a
single paragraph, causing all deal info to render on one line in Matrix
clients. Build HTML directly with <br> tags for reliable line breaks.
Also adds html.escape() for proper escaping of titles and prices, and
removes the unused markdown dependency.

https://claude.ai/code/session_01B7YPGrE3NatkwadCXVjv2j
2026-02-28 05:23:37 +00:00
Claude
949eceb983 Filter ITAD deals to only include games and DLC
Non-game content (courses, software bundles) was showing up in deal
posts. Filter on the API's type field to only include entries with
type "game" or "dlc".

https://claude.ai/code/session_01B7YPGrE3NatkwadCXVjv2j
2026-02-28 05:14:27 +00:00
prosolis
1dcb76a394 Merge pull request #11 from prosolis/claude/fix-isthereanydeal-api-W5umt
CheapShark kinda sucks.. let's move to ITAD instead
2026-02-27 21:06:12 -08:00
Claude
d1a33e97c5 Update README to document ITAD as a deal source and DEAL_SOURCES config
https://claude.ai/code/session_01B7YPGrE3NatkwadCXVjv2j
2026-02-28 05:04:24 +00:00
Claude
34da126507 Add IsThereAnyDeal as a deal source alongside CheapShark
Users can now choose between CheapShark, ITAD, or both via the
DEAL_SOURCES env var (comma-separated, default: "cheapshark"). When
"itad" is included, the bot polls GET /deals/v2 for current deals with
discount/price filtering and posts them with the same formatting style.
ITAD deals include built-in historical low detection via the API's
deal flags. Preflight checks enforce ITAD_API_KEY when ITAD is a
configured deal source.

https://claude.ai/code/session_01B7YPGrE3NatkwadCXVjv2j
2026-02-28 04:59:27 +00:00
Claude
72d86fd4e5 Fix IsThereAnyDeal API: use POST for overview endpoint and lookup game UUIDs
The ITAD v2 API requires POST (not GET) for /games/overview/v2, and
expects ITAD game UUIDs in the JSON body rather than Steam app IDs.
Added a lookup step via GET /games/lookup/v1 to convert Steam app IDs
to ITAD UUIDs before calling the overview endpoint. Updated preflight
check to use the lookup endpoint for API key validation.

https://claude.ai/code/session_01B7YPGrE3NatkwadCXVjv2j
2026-02-28 04:47:00 +00:00
prosolis
a83f230291 Merge pull request #10 from prosolis/claude/fix-cheapshark-rating-bug-pxVJv
Post Epic free games on first run instead of silently recording them
2026-02-27 19:38:10 -08:00
Claude
0302cea523 Post Epic free games on first run instead of silently recording them
On first startup, _populate_initial_state() was marking current Epic free
games as "posted" without actually sending them to the room. This meant
users had to wait until the next cycle of new games before seeing anything.

Now only CheapShark deals are silently recorded on first run (there can be
dozens). Epic free games are left for check_epic_free_games() to pick up
and post immediately, since they are few in number and time-limited.

https://claude.ai/code/session_017eMsVwUopgmnEyd6JJedpV
2026-02-28 03:32:25 +00:00
prosolis
a334cb7bbe Merge pull request #9 from prosolis/claude/fix-cheapshark-rating-bug-pxVJv
Add SEND_INTRO_MESSAGE to .env.example
2026-02-27 19:13:29 -08:00
Claude
c486b1f5c6 Add SEND_INTRO_MESSAGE to .env.example
https://claude.ai/code/session_017eMsVwUopgmnEyd6JJedpV
2026-02-28 03:07:29 +00:00
prosolis
66407c5a43 Merge pull request #8 from prosolis/claude/fix-cheapshark-rating-bug-pxVJv
More bugfixes
2026-02-27 19:05:26 -08:00
Claude
13cdd6d8b5 Document SEND_INTRO_MESSAGE in README config table
https://claude.ai/code/session_017eMsVwUopgmnEyd6JJedpV
2026-02-28 03:02:56 +00:00
Claude
703f92d46c Add .gitignore for Python bytecode files
https://claude.ai/code/session_017eMsVwUopgmnEyd6JJedpV
2026-02-28 03:01:49 +00:00
Claude
0fd58c32b4 Add optional intro message on bot startup
When SEND_INTRO_MESSAGE=true, the bot sends "The deals must flow." as
an m.notice to the Matrix room right after startup, before the first
scheduled deal checks. Defaults to off.

https://claude.ai/code/session_017eMsVwUopgmnEyd6JJedpV
2026-02-28 03:01:20 +00:00
prosolis
19c070405e Merge pull request #7 from prosolis/claude/fix-cheapshark-rating-bug-pxVJv
Fix cheapshark rating and sorting issue
2026-02-27 18:50:37 -08:00
Claude
3f7e8196e3 Sort CheapShark deals by recency instead of deal rating
The bot polls periodically for new deals, but sorting by "Deal Rating"
meant it always returned the same top-rated deals and would never
discover new listings that aren't in the top 10 by rating. Sorting by
"recent" ensures newly added or updated deals are seen on each poll.

https://claude.ai/code/session_017eMsVwUopgmnEyd6JJedpV
2026-02-28 02:49:28 +00:00
Claude
c33e46c3cf Fix CheapShark rating filter: correct scale and skip unrated deals
Two bugs fixed:
1. Function signature used old 0-100 scale defaults (min_rating: int = 80)
   but dealRating from CheapShark is 0-10. Updated to float = 8.0.
2. Deals with dealRating of 0.0 (unrated/insufficient data) were being
   filtered out as "poorly rated". Now treats 0.0 as unrated and skips
   the rating check, so games like Leisure Suit Larry that lack a
   CheapShark deal rating aren't incorrectly excluded.

https://claude.ai/code/session_017eMsVwUopgmnEyd6JJedpV
2026-02-28 02:47:15 +00:00
prosolis
c145d83b0b Merge pull request #6 from prosolis/claude/gaming-deals-matrix-bot-ONjS7
Fixed confusing rating for CheapShark, added debugging.
2026-02-27 18:34:08 -08:00
Claude
c114f3e99f Add debug logging for deal filtering and --debug flag
Log the raw deal count before filtering and log each filtered-out
deal with the reason (savings too low, rating too low) at DEBUG level.
Use --debug flag to enable verbose output for troubleshooting.

https://claude.ai/code/session_01LPpSZFfyh6vdV5HGFWjoQX
2026-02-28 02:29:43 +00:00
Claude
88377e258a Use CheapShark's native 0-10 scale for MIN_DEAL_RATING
The previous 0-100 scale with a * 10 conversion was confusing —
CheapShark returns deal ratings as floats (e.g. 9.8, 7.5) so the
config should match. Default is now 8.0 instead of 80.

https://claude.ai/code/session_01LPpSZFfyh6vdV5HGFWjoQX
2026-02-28 02:21:24 +00:00
prosolis
7b05d86dc5 Merge pull request #5 from prosolis/claude/gaming-deals-matrix-bot-ONjS7
Load .env file at startup via python-dotenv
2026-02-27 18:05:40 -08:00
Claude
3138fe314f Load .env file at startup via python-dotenv
Running directly with `python -m gaming_deals_bot` didn't pick up
variables from .env — only the Docker path (--env-file) did. Now
dotenv is loaded before config parsing so both workflows work.

https://claude.ai/code/session_01LPpSZFfyh6vdV5HGFWjoQX
2026-02-28 02:04:37 +00:00
prosolis
b6b674ca0e Merge pull request #4 from prosolis/claude/gaming-deals-matrix-bot-ONjS7
Add --check preflight to validate config and connectivity
2026-02-27 17:54:31 -08:00
Claude
016d2c1973 Add --check preflight to validate config and connectivity
`python -m gaming_deals_bot --check` tests each external dependency
before starting the bot:

- Matrix: verifies access token (whoami) and room membership
- CheapShark: hits the deals endpoint
- Epic Games Store: hits the free-games endpoint
- Frankfurter: fetches exchange rates
- IsThereAnyDeal: validates the API key (skipped if not set)

Exits 0/1 so it works in CI pipelines and Docker health-checks.

https://claude.ai/code/session_01LPpSZFfyh6vdV5HGFWjoQX
2026-02-28 01:52:48 +00:00
prosolis
c09ecdbd21 Merge pull request #3 from prosolis/claude/gaming-deals-matrix-bot-ONjS7
Add instructions for obtaining a Matrix bot access token
2026-02-27 17:45:15 -08:00
Claude
d5f30487cb Add instructions for obtaining a Matrix bot access token
Walk through creating a bot account, logging in via the client API
to retrieve the access token, and inviting the bot to the room.

https://claude.ai/code/session_01LPpSZFfyh6vdV5HGFWjoQX
2026-02-28 01:39:32 +00:00
prosolis
aed260f345 Merge pull request #2 from prosolis/claude/gaming-deals-matrix-bot-ONjS7
Display all the main currencies
2026-02-27 16:58:54 -08:00
Claude
6fdbc9f9a0 Reduce exchange rate refresh to twice daily
Be respectful of the free Frankfurter API — ECB rates only update once
a day anyway, so a 12-hour cache TTL is more than sufficient.

https://claude.ai/code/session_01LPpSZFfyh6vdV5HGFWjoQX
2026-02-28 00:56:21 +00:00
Claude
8277cf37e2 Add multi-currency pricing (USD, CAD, EUR, GBP) for deal posts
Fetches live exchange rates from the Frankfurter API (ECB data, free,
no API key) and displays converted prices alongside USD in every deal
message. Rates are cached in memory and auto-refreshed hourly.

https://claude.ai/code/session_01LPpSZFfyh6vdV5HGFWjoQX
2026-02-28 00:51:52 +00:00
prosolis
ba1a3811d6 Merge pull request #1 from prosolis/claude/gaming-deals-matrix-bot-ONjS7
Add gaming deals Matrix bot
2026-02-27 16:07:45 -08:00
Claude
6e84429ad1 Add gaming deals Matrix bot
Implements a Matrix bot that posts PC gaming deals and free game alerts:
- CheapShark API integration (Steam, GOG, Humble, GMG) polled every 2 hours
- Epic Games Store free games detection polled daily
- IsThereAnyDeal historical low price flagging (optional)
- SQLite deduplication with 30-day pruning
- First-run population (records existing deals without posting)
- Matrix-flavored HTML + plain text fallback messages
- Dockerfile for containerized deployment

https://claude.ai/code/session_01LPpSZFfyh6vdV5HGFWjoQX
2026-02-28 00:00:22 +00:00
prosolis
11a3eace9f Initial commit 2026-02-27 15:47:43 -08:00