umer6016 commited on
Commit
60823cc
·
verified ·
1 Parent(s): c2c9643

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. streamlit_app.py +19 -0
streamlit_app.py CHANGED
@@ -159,6 +159,25 @@ if ALPHA_VANTAGE_KEY:
159
  else:
160
  st.sidebar.warning("Alpha Vantage: Missing ⚠️ (Using Mock Data)")
161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  # --- Main Logic ---
163
 
164
  # 1. Fetch Data
 
159
  else:
160
  st.sidebar.warning("Alpha Vantage: Missing ⚠️ (Using Mock Data)")
161
 
162
+ # --- Network Diagnostics ---
163
+ with st.sidebar.expander("📡 Network Diagnostics", expanded=False):
164
+ if st.button("Run Connectivity Test"):
165
+ import socket
166
+
167
+ # Test 1: Google DNS (General Internet)
168
+ try:
169
+ ip = socket.gethostbyname("google.com")
170
+ st.success(f"Google DNS: OK ({ip})")
171
+ except Exception as e:
172
+ st.error(f"Google DNS Failed: {e}")
173
+
174
+ # Test 2: Discord DNS
175
+ try:
176
+ ip = socket.gethostbyname("discord.com")
177
+ st.success(f"Discord DNS: OK ({ip})")
178
+ except Exception as e:
179
+ st.error(f"Discord DNS Failed: {e}")
180
+
181
  # --- Main Logic ---
182
 
183
  # 1. Fetch Data