File size: 2,861 Bytes
eb0b385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env python3
"""Check warehouse API live for Marlin products"""

import requests
import re

def check_warehouse():
    """Check what's really in warehouse"""
    
    url = 'https://video.trek-turkey.com/bizimhesap-warehouse-xml-b2b-api-v2.php'
    
    try:
        response = requests.get(url, verify=False, timeout=15)
        if response.status_code != 200:
            print(f"Failed: {response.status_code}")
            return
            
        xml_text = response.text
        print(f"✅ API Response received: {len(xml_text)} chars")
        
        # Extract ALL product names
        product_pattern = r'<ProductName><!\[CDATA\[(.*?)\]\]></ProductName>'
        products = re.findall(product_pattern, xml_text)
        
        print(f"Total products: {len(products)}")
        print("\n" + "="*60)
        
        # Look for Marlin with different patterns
        print("SEARCHING FOR MARLIN VARIATIONS:")
        marlin_found = []
        
        for p in products:
            p_upper = p.upper()
            # Check various Marlin patterns
            if any(x in p_upper for x in ['MARLIN', 'MARLİN', 'MARL1N']):
                marlin_found.append(p)
                
        if marlin_found:
            print(f"✅ Found {len(marlin_found)} Marlin products:")
            for m in marlin_found:
                print(f"  - {m}")
        else:
            print("❌ NO MARLIN PRODUCTS FOUND")
            
        # Check for common Trek products
        print("\n" + "="*60)
        print("TREK BIKE PRODUCTS (first 20):")
        trek_bikes = []
        for p in products:
            p_upper = p.upper()
            if any(x in p_upper for x in ['TREK', 'RAIL', 'FX', 'DOMANE', 'CHECKPOINT', 'EMONDA']):
                if not any(x in p_upper for x in ['HANGER', 'KULAK', 'VIDA', 'KAPAK', 'BATARYA']):
                    trek_bikes.append(p)
                    if len(trek_bikes) >= 20:
                        break
                        
        for t in trek_bikes:
            print(f"  - {t}")
            
        # Search for products with "5" in name
        print("\n" + "="*60)
        print("Products with '5' (bike models, first 10):")
        five_products = []
        for p in products:
            if '5' in p and not any(x in p.upper() for x in ['HANGER', 'KULAK', 'VIDA', 'KAPAK']):
                five_products.append(p)
                if len(five_products) >= 10:
                    break
                    
        for f in five_products:
            print(f"  - {f}")
            
    except Exception as e:
        print(f"❌ Error: {e}")
        print(f"Error type: {type(e).__name__}")

if __name__ == "__main__":
    print("Checking live warehouse API...")
    print("URL: https://video.trek-turkey.com/bizimhesap-warehouse-xml-b2b-api-v2.php")
    print("="*60)
    check_warehouse()