Rename app.py to main_dashboard.py
Browse files- app.py β main_dashboard.py +65 -5
app.py β main_dashboard.py
RENAMED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
# main_dashboard.py
|
| 2 |
import streamlit as st
|
| 3 |
import os
|
|
|
|
|
|
|
| 4 |
|
| 5 |
def main():
|
| 6 |
st.set_page_config(
|
|
@@ -20,9 +22,31 @@ def main():
|
|
| 20 |
.facebook-pro-card { border-left-color: #FF6B35; }
|
| 21 |
.feature-list { margin: 1rem 0; padding-left: 1.5rem; flex-grow: 1; }
|
| 22 |
.api-key-section { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 1.5rem; border-radius: 10px; margin-bottom: 2rem; }
|
|
|
|
| 23 |
</style>
|
| 24 |
""", unsafe_allow_html=True)
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
# Header
|
| 27 |
st.markdown("""
|
| 28 |
<div class="main-header">
|
|
@@ -30,7 +54,7 @@ def main():
|
|
| 30 |
<p style="margin:0; opacity: 0.9;">100% Free - No Local Setup Required</p>
|
| 31 |
</div>
|
| 32 |
""", unsafe_allow_html=True)
|
| 33 |
-
|
| 34 |
# Platform selection
|
| 35 |
st.markdown("## π Launch Extractors")
|
| 36 |
|
|
@@ -87,13 +111,49 @@ def main():
|
|
| 87 |
if st.button("π Launch Facebook Extractor 2.0", key="facebook_pro_btn", use_container_width=True):
|
| 88 |
st.switch_page("pages/facebook_extractor_pro.py")
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
# Instructions
|
| 91 |
with st.expander("π How to Use", expanded=True):
|
| 92 |
st.markdown("""
|
| 93 |
-
1. **
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
""")
|
| 98 |
|
| 99 |
if __name__ == "__main__":
|
|
|
|
| 1 |
# main_dashboard.py
|
| 2 |
import streamlit as st
|
| 3 |
import os
|
| 4 |
+
import requests
|
| 5 |
+
from datetime import datetime
|
| 6 |
|
| 7 |
def main():
|
| 8 |
st.set_page_config(
|
|
|
|
| 22 |
.facebook-pro-card { border-left-color: #FF6B35; }
|
| 23 |
.feature-list { margin: 1rem 0; padding-left: 1.5rem; flex-grow: 1; }
|
| 24 |
.api-key-section { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 1.5rem; border-radius: 10px; margin-bottom: 2rem; }
|
| 25 |
+
.status-box { background-color: #1a1a2e; padding: 1rem; border-radius: 5px; margin: 0.5rem 0; min-height: 120px; }
|
| 26 |
</style>
|
| 27 |
""", unsafe_allow_html=True)
|
| 28 |
|
| 29 |
+
# API Key Section
|
| 30 |
+
st.markdown("""
|
| 31 |
+
<div class="api-key-section">
|
| 32 |
+
<h2 style="margin:0; color:white;">π HuggingFace API Key Required</h2>
|
| 33 |
+
<p style="margin:0; color:white; opacity:0.9;">Get FREE API key from: <a href="https://huggingface.co/settings/tokens" target="_blank" style="color:white; text-decoration:underline;">huggingface.co/settings/tokens</a></p>
|
| 34 |
+
</div>
|
| 35 |
+
""", unsafe_allow_html=True)
|
| 36 |
+
|
| 37 |
+
# API Configuration
|
| 38 |
+
hf_api_key = st.text_input(
|
| 39 |
+
"π€ Enter Your HuggingFace API Key",
|
| 40 |
+
type="password",
|
| 41 |
+
placeholder="hf_xxxxxxxxxxxxxxxx",
|
| 42 |
+
help="Get FREE API key from huggingface.co/settings/tokens"
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
# Store API key
|
| 46 |
+
if hf_api_key:
|
| 47 |
+
st.session_state.hf_api_key = hf_api_key
|
| 48 |
+
st.success("β
HuggingFace API Key saved! You can now launch extractors.")
|
| 49 |
+
|
| 50 |
# Header
|
| 51 |
st.markdown("""
|
| 52 |
<div class="main-header">
|
|
|
|
| 54 |
<p style="margin:0; opacity: 0.9;">100% Free - No Local Setup Required</p>
|
| 55 |
</div>
|
| 56 |
""", unsafe_allow_html=True)
|
| 57 |
+
|
| 58 |
# Platform selection
|
| 59 |
st.markdown("## π Launch Extractors")
|
| 60 |
|
|
|
|
| 111 |
if st.button("π Launch Facebook Extractor 2.0", key="facebook_pro_btn", use_container_width=True):
|
| 112 |
st.switch_page("pages/facebook_extractor_pro.py")
|
| 113 |
|
| 114 |
+
# Status
|
| 115 |
+
st.markdown("---")
|
| 116 |
+
st.subheader("π Current Status")
|
| 117 |
+
|
| 118 |
+
status_col1, status_col2, status_col3 = st.columns(3)
|
| 119 |
+
|
| 120 |
+
with status_col1:
|
| 121 |
+
st.markdown("### πΌ LinkedIn")
|
| 122 |
+
st.success("β
Ready to launch")
|
| 123 |
+
|
| 124 |
+
with status_col2:
|
| 125 |
+
st.markdown("### π Facebook")
|
| 126 |
+
st.info("β οΈ Limited functionality in cloud")
|
| 127 |
+
|
| 128 |
+
with status_col3:
|
| 129 |
+
st.markdown("### π₯ Facebook 2.0")
|
| 130 |
+
st.info("β οΈ Limited functionality in cloud")
|
| 131 |
+
|
| 132 |
# Instructions
|
| 133 |
with st.expander("π How to Use", expanded=True):
|
| 134 |
st.markdown("""
|
| 135 |
+
1. **Get FREE API Key:**
|
| 136 |
+
- Go to https://huggingface.co/settings/tokens
|
| 137 |
+
- Create account (FREE)
|
| 138 |
+
- Click "New token"
|
| 139 |
+
- Copy your token (starts with hf_)
|
| 140 |
+
|
| 141 |
+
2. **Enter API Key above**
|
| 142 |
+
|
| 143 |
+
3. **Click any extractor to launch**
|
| 144 |
+
|
| 145 |
+
4. **For LinkedIn:** Works immediately with any LinkedIn URL
|
| 146 |
+
|
| 147 |
+
5. **For Facebook:** Limited functionality in cloud deployment
|
| 148 |
+
|
| 149 |
+
6. **For full Facebook features:** Run locally with Selenium
|
| 150 |
+
|
| 151 |
+
**Current Features:**
|
| 152 |
+
- β
LinkedIn data extraction (profiles, companies, posts)
|
| 153 |
+
- β
AI-powered analysis with HuggingFace
|
| 154 |
+
- β
Conversation memory
|
| 155 |
+
- β
Vector-based search
|
| 156 |
+
- β οΈ Facebook (limited to public data in cloud)
|
| 157 |
""")
|
| 158 |
|
| 159 |
if __name__ == "__main__":
|