b3b6b702d1
- publish_gatekeeper.py (neues Gatekeeper-System) - 4 Premium-Artikel: Veggie Match, Berlin 1960, Wild Tiled West, Scream Park - Alle kumulierten Artikel, Scripts, Medien und Caches
17 lines
719 B
Python
17 lines
719 B
Python
import json, urllib.request
|
|
|
|
TOKEN = open('...nAPI = 'https://www.brettspiel-news.de/api/index.php/v1/content/articles'
|
|
HEADERS = {'Accept': 'application/vnd.api+json', 'X-Joomla-Token': TOKEN}
|
|
|
|
for aid in [15488, 15485, 15486, 15487]:
|
|
req = urllib.request.Request(f'{API}/{aid}', headers=HEADERS)
|
|
r = json.loads(urllib.request.urlopen(req).read())
|
|
attrs = r['data']['attributes']
|
|
text = attrs.get('text', '')
|
|
has_box = ('Vorbestellbar' in text[:600]) or ('border: 2px' in text[:600])
|
|
has_rm = 'system-readmore' in text
|
|
|
|
print(f"#{aid}: {len(text)} chars | box={'OK' if has_box else 'MISSING'} | readmore={'OK' if has_rm else 'MISSING'}")
|
|
print(f" Start: {text[:200]}")
|
|
print()
|