mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-20 21:58:49 +02:00
feat: Implement comprehensive search configurations for discount stores and add Gifi-specific search and analysis tools.
This commit is contained in:
1 parent
63073d03b5
commit
c159036583
22 files changed
+19849
-14
No files matched your search
@@ -0,0 +1,42 @@
|
||||
"""
|
||||
Test Carrefour via API endpoint (production-like)
|
||||
"""
|
||||
import requests
|
||||
import json
|
||||
|
||||
url = "http://localhost:8555/api/search"
|
||||
params = {
|
||||
"q": "chaise",
|
||||
"sites": "7", # Carrefour site ID
|
||||
"max_results": 10
|
||||
}
|
||||
|
||||
print(f"Testing: {url}")
|
||||
print(f"Params: {params}\n")
|
||||
|
||||
response = requests.get(url, params=params, stream=True)
|
||||
|
||||
print(f"Status: {response.status_code}")
|
||||
print(f"Headers: {dict(response.headers)}\n")
|
||||
|
||||
count = 0
|
||||
for line in response.iter_lines():
|
||||
if line:
|
||||
try:
|
||||
# Each line should be JSON
|
||||
data = json.loads(line.decode('utf-8'))
|
||||
count += 1
|
||||
|
||||
title = data.get('title', 'N/A')[:60]
|
||||
price = data.get('price', 'N/A')
|
||||
image = "✅" if data.get('image_url') else "❌"
|
||||
|
||||
print(f"{count}. [{image}] {title} - {price}€")
|
||||
|
||||
if count >= 10:
|
||||
break
|
||||
except json.JSONDecodeError as e:
|
||||
print(f"JSON Error: {e}")
|
||||
print(f"Line: {line[:100]}")
|
||||
|
||||
print(f"\nTotal: {count} results")
|
||||
Reference in new issue
Block a user