Dmitry Beresnev commited on
Commit Β·
444359f
1
Parent(s): a6e7f4a
fix news dashboard
Browse files353 unmodified lines3543553563573573583593603613623633643593653663673683693703713723733743753763773783793803817 unmodified lines3893903913733923933943953963973983993754004014024034044054064074084094104114124134144154167 unmodified lines424425426389427428429430431432433434391435436437438439440441442443444445446447448449450451353 unmodified lines height="700px" ) elif not twitter_df.empty or not reddit_df.empty: st.info("π No Twitter/Reddit news matches your current filters.") st.markdown(""" <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;"> <div style="font-size: 48px; margin-bottom: 16px;">π</div> <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">No matches found</div> <div style="color: #787B86; font-size: 13px;">Try adjusting your filters to see Twitter/X & Reddit news</div> </div> """, unsafe_allow_html=True) else: st.info("β³ Fetching Twitter & Reddit news... This may take 30-60 seconds on first load.") st.markdown(""" <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;"> <div style="font-size: 48px; margin-bottom: 16px; animation: pulse 2s ease-in-out infinite;">β³</div> <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">Loading Twitter/X & Reddit News</div> <div style="color: #787B86; font-size: 13px;">Fetching real-time news from premium sources...</div> <div style="color: #787B86; font-size: 12px; margin-top: 8px; opacity: 0.7;">This may take 30-60 seconds on first load</div> </div> <style> @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.1); } } </style> """, unsafe_allow_html=True)
with col2: # SECTION 2: Main Page News (Web-Scraped)7 unmodified lines height="700px" ) elif not rss_main_df.empty: st.info("π No main page news matches your filters.") st.markdown(""" <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;"> <div style="font-size: 48px; margin-bottom: 16px;">π</div> <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">No matches found</div> <div style="color: #787B86; font-size: 13px;">Try adjusting your filters to see top headlines</div> </div> """, unsafe_allow_html=True) else: st.info("β³ Main page news will appear here...") st.markdown(""" <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;"> <div style="font-size: 48px; margin-bottom: 16px; animation: pulse 2s ease-in-out infinite;">β³</div> <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">Loading Top Headlines</div> <div style="color: #787B86; font-size: 13px;">Fetching latest news from major outlets...</div> <div style="color: #787B86; font-size: 12px; margin-top: 8px; opacity: 0.7;">Web scraping main pages</div> </div> <style> @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.1); } } </style> """, unsafe_allow_html=True)
with col3: # SECTION 3: RSS Feed News7 unmodified lines height="700px" ) elif not rss_all_df.empty: st.info("π No RSS news matches your current filters.") st.markdown(""" <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;"> <div style="font-size: 48px; margin-bottom: 16px;">π</div> <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">No matches found</div> <div style="color: #787B86; font-size: 13px;">Try adjusting your filters to see RSS feed news</div> </div> """, unsafe_allow_html=True) else: st.info("β³ RSS feed news will appear here...") st.markdown(""" <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;"> <div style="font-size: 48px; margin-bottom: 16px; animation: pulse 2s ease-in-out infinite;">β³</div> <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">Loading RSS Feed</div> <div style="color: #787B86; font-size: 13px;">Aggregating news from all RSS sources...</div> <div style="color: #787B86; font-size: 12px; margin-top: 8px; opacity: 0.7;">Bloomberg, Reuters, FT, WSJ & more</div> </div> <style> @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.1); } } </style> """, unsafe_allow_html=True)
# Auto-refresh logicif auto_refresh:app/pages/05_Dashboard.py+63-6