-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug_rss.py
More file actions
58 lines (45 loc) · 1.65 KB
/
debug_rss.py
File metadata and controls
58 lines (45 loc) · 1.65 KB
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
#!/usr/bin/env python3
"""
Debug script to test RSS service and see what's happening with Selenium extraction
"""
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from services.rss_service import RSSService
import time
def test_rss_service():
"""Test the RSS service step by step"""
print("🔍 Testing RSS Service...")
rss = RSSService()
# Test the feed URL
feed_url = "https://www.oddsshark.com/rss.xml"
print(f"\n📡 Testing feed: {feed_url}")
try:
# Test basic connectivity first
print("\n1️⃣ Testing basic connectivity...")
test_result = rss.test_feed_connectivity(feed_url)
print(f" Status: {test_result['status']}")
print(f" Message: {test_result['message']}")
print(f" Entries: {test_result['entries_count']}")
# Now test the full processing
print("\n2️⃣ Testing full RSS processing...")
start_time = time.time()
result = rss.process_rss_feed(feed_url, 5)
end_time = time.time()
print(f" Processing time: {end_time - start_time:.2f} seconds")
print(f" Result count: {len(result)}")
if result:
print(f" First entry: {result[0]['title']}")
print(f" Source: {result[0]['source']}")
print(f" Sport: {result[0]['sport_type']}")
else:
print(" No results returned")
except Exception as e:
print(f"❌ Error during testing: {str(e)}")
import traceback
traceback.print_exc()
finally:
# Clean up
rss._close_selenium_driver()
if __name__ == "__main__":
test_rss_service()