#!/usr/bin/env python3 import urllib.request, json, sys, os SKIP_KW = ['5e', '5th edition', 'handbook', 'rpg', 'd&d', 'dnd', 'roleplaying game', 'ttrpg', 'dungeon master', 'stl', '15mm', '28mm', '32mm', 'resin', 'miniature', 'plastic regiment', 'multi-part', '3d print', 'terrain', 'dice', 'dice bag', 'dice tray', 'playmat', 'token', 'map pack', 'battle map', 'touchscreen', 'mapcase', 'character sheet', 'spellbook', 'soundtrack', 'soundscapes', 'music album', 'props', 'makeup', 'accessory'] # Fetch Gamefound full data req = urllib.request.Request( "https://gamefound.com/api/public/projects/getActiveCrowdfundingProjects", headers={"Accept": "application/json"} ) with urllib.request.urlopen(req, timeout=30) as resp: gf_data = json.loads(resp.read().decode()) # Save raw data with open("/home/hermes/workspace/gf_raw.json", "w") as f: json.dump(gf_data, f, indent=2) print(f"Gamefound projects saved: {len(gf_data)}") bg = [] skip = [] for p in gf_data: name = (p.get('projectName') or '').lower() desc = (p.get('shortDescription') or '').lower() combined = name + ' ' + desc is_skip = any(kw in combined for kw in SKIP_KW) if is_skip: skip.append(p.get('projectName','?')) else: bg.append(p) print(f"Board games (GF): {len(bg)}") print(f"Skipped (GF): {len(skip)}") print(f"Skipped first 10: {skip[:10]}") with open("/home/hermes/workspace/gf_filtered.json", "w") as f: json.dump(bg, f, indent=2) print("DONE")