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
This commit is contained in:
@@ -14,6 +14,12 @@ class Config:
|
||||
# ITAD API key (optional — historical low checks disabled without it)
|
||||
self.itad_api_key = os.environ.get("ITAD_API_KEY", "")
|
||||
|
||||
# Deal sources: comma-separated list of "cheapshark", "itad" (default: cheapshark)
|
||||
raw_sources = os.environ.get("DEAL_SOURCES", "cheapshark")
|
||||
self.deal_sources: list[str] = [
|
||||
s.strip().lower() for s in raw_sources.split(",") if s.strip()
|
||||
]
|
||||
|
||||
# Deal filtering
|
||||
self.min_deal_rating = float(os.environ.get("MIN_DEAL_RATING", "8.0"))
|
||||
self.min_discount_percent = int(os.environ.get("MIN_DISCOUNT_PERCENT", "50"))
|
||||
|
||||
Reference in New Issue
Block a user