|
|
|
"""Debug warehouse XML to understand product names""" |
|
|
|
import requests |
|
import re |
|
|
|
def debug_warehouse(): |
|
"""Check what's in warehouse XML""" |
|
|
|
url = 'https://veloconnect.wardin.com/v1/wardin?auth_token=97e0949096e88dd936f1bc2f0ffd3a07&auth_source=alatin.com.tr' |
|
|
|
try: |
|
response = requests.get(url, verify=False, timeout=10) |
|
if response.status_code != 200: |
|
print(f"Failed to fetch: {response.status_code}") |
|
return |
|
|
|
xml_text = response.text |
|
print(f"XML size: {len(xml_text)} chars") |
|
|
|
|
|
product_pattern = r'<ProductName><!\[CDATA\[(.*?)\]\]></ProductName>' |
|
products = re.findall(product_pattern, xml_text) |
|
|
|
print(f"Total products: {len(products)}") |
|
print("\n" + "="*60) |
|
|
|
|
|
print("Products containing '5':") |
|
for p in products: |
|
if '5' in p: |
|
print(f" - {p}") |
|
|
|
print("\n" + "="*60) |
|
print("Products containing 'MARLIN' or 'marlin':") |
|
for p in products: |
|
if 'MARLIN' in p.upper(): |
|
print(f" - {p}") |
|
|
|
print("\n" + "="*60) |
|
print("First 20 Trek brand products:") |
|
trek_products = [p for p in products if 'TREK' in p.upper() or 'FX' in p or 'DOMANE' in p.upper() or 'RAIL' in p.upper()] |
|
for p in trek_products[:20]: |
|
print(f" - {p}") |
|
|
|
print("\n" + "="*60) |
|
print("Looking for pattern variations of Marlin:") |
|
patterns = ['MARLIN', 'MARLİN', 'MARL1N', 'M4RL1N', 'MARLYN'] |
|
for pattern in patterns: |
|
found = [p for p in products if pattern in p.upper()] |
|
if found: |
|
print(f"\nPattern '{pattern}' found in:") |
|
for f in found[:5]: |
|
print(f" - {f}") |
|
|
|
except Exception as e: |
|
print(f"Error: {e}") |
|
|
|
if __name__ == "__main__": |
|
debug_warehouse() |