-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyc_streamlight_app.py
More file actions
64 lines (52 loc) · 2.24 KB
/
yc_streamlight_app.py
File metadata and controls
64 lines (52 loc) · 2.24 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
59
60
61
62
63
64
import streamlit as st
import pandas as pd
import time
from yc_enrich import fetch_all_companies_s25, extract_linkedin_url, check_yc_mention
st.set_page_config(page_title="YC S25 Live Parser", layout="wide")
st.title("Y Combinator Summer 2025 — Live Parsing")
st.caption("Companies appear below as soon as they are processed.")
if "df" not in st.session_state:
st.session_state.df = pd.DataFrame(columns=[
"Name", "Website", "YC Page", "LinkedIn", "YC S25 on LinkedIn"
])
if "seen_slugs" not in st.session_state:
st.session_state.seen_slugs = set()
if st.button("Start live parsing"):
placeholder = st.empty()
progress_bar = st.progress(0, text="Fetching company list…")
with st.spinner("Downloading company list from Algolia…"):
all_companies = fetch_all_companies_s25()
total = len(all_companies)
progress_bar.progress(0, text=f"0 / {total} parsed")
for i, company in enumerate(all_companies, start=1):
slug = company.get("slug")
if slug in st.session_state.seen_slugs:
progress_bar.progress(i / total, text=f"{i} / {total} skipped dup")
continue
st.session_state.seen_slugs.add(slug)
name = company.get("name")
website = company.get("website")
yc_url = f"https://www.ycombinator.com/companies/{slug}"
linkedin_url = extract_linkedin_url(slug)
yc_s25_flag = check_yc_mention(linkedin_url) if linkedin_url else None
st.session_state.df.loc[len(st.session_state.df)] = {
"Name": name,
"Website": website,
"YC Page": yc_url,
"LinkedIn": linkedin_url,
"YC S25 on LinkedIn": yc_s25_flag
}
placeholder.dataframe(st.session_state.df, use_container_width=True)
progress_bar.progress(i / total, text=f"{i} / {total} parsed")
time.sleep(0.3)
st.session_state.df.drop_duplicates(subset="YC Page", inplace=True, ignore_index=True)
progress_bar.empty()
st.success("Parsing completed")
if not st.session_state.df.empty:
st.download_button(
"Download CSV",
data=st.session_state.df.to_csv(index=False),
file_name="yc_s25_live.csv",
mime="text/csv",
key="download-yc-s25"
)