-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.py
More file actions
269 lines (228 loc) · 13.4 KB
/
Copy pathdemo.py
File metadata and controls
269 lines (228 loc) · 13.4 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
"""
Demo script — simulates a full Sniper pipeline run with sanitized fake data.
Used to record the asciinema demo GIF. No real API calls. No real data.
Every company, email, and output is synthetic per Clean Room Protocol.
Run: python demo.py
"""
import time
import sys
def slow_print(text: str, delay: float = 0.012):
"""Print text character by character for a realistic typing effect."""
for char in text:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(delay)
print()
def line(text: str = ""):
print(text)
def pause(secs: float):
time.sleep(secs)
# ── Fake data — ALL SANITIZED ────────────────────────────────────────────────
FAKE_SCRAPE_RESULTS = [
# Keyword 1 results
{"company": "Apex Property Group", "email": "sarah.chen@apexpropertygroup.example.com", "jobTitle": "Office Manager", "salary": "$65,000–$75,000", "contactName": "Sarah Chen"},
{"company": "Meridian Capital Realty", "email": "james.morgan@meridiancr.example.com", "jobTitle": "Operations Coordinator", "salary": "$58,000–$68,000", "contactName": "James Morgan"},
{"company": "Summit Ridge Management", "email": "emily.walsh@summitridgemgmt.example.com", "jobTitle": "Property Administrator", "salary": "$55,000–$62,000", "contactName": "Emily Walsh"},
{"company": "PrideStaff", "email": "recruiter@pridestaff.example.com", "jobTitle": "Office Manager", "salary": "not listed", "contactName": ""}, # blocked company
{"company": "Harborview Properties", "email": "michael.torres@harborviewprop.example.com", "jobTitle": "Community Manager", "salary": "$72,000–$85,000", "contactName": "Michael Torres"},
{"company": "Coastal Group", "email": "hr@coastalgroup.example.com", "jobTitle": "Admin Assistant", "salary": "$45,000–$52,000", "contactName": ""},
# Keyword 2 results — includes a dupe + blocked domain
{"company": "Apex Property Group", "email": "sarah.chen@apexpropertygroup.example.com", "jobTitle": "Office Manager", "salary": "$65,000–$75,000", "contactName": "Sarah Chen"}, # DUPE
{"company": "Northgate Real Estate", "email": "lisa.park@northgatemgmt.example.com", "jobTitle": "Leasing Coordinator", "salary": "$50,000–$58,000", "contactName": "Lisa Park"},
{"company": "Ironwood Residential", "email": "poster@indeed.example.com", "jobTitle": "Community Mgr", "salary": "not listed", "contactName": ""}, # blocked domain
{"company": "Cresthaven Partners", "email": "david.kim@cresthaven.example.com", "jobTitle": "Operations Manager", "salary": "$80,000–$95,000", "contactName": "David Kim"},
{"company": "Stonegate Holdings", "email": "amanda.ross@stonegatehold.example.com", "jobTitle": "Admin Coordinator", "salary": "$48,000–$55,000", "contactName": "Amanda Ross"},
]
# Hunter verification results: pass / flag / reject mix
VERIFICATION_RESULTS = {
"sarah.chen@apexpropertygroup.example.com": {"score": 97, "tier": "pass"},
"james.morgan@meridiancr.example.com": {"score": 94, "tier": "pass"},
"emily.walsh@summitridgemgmt.example.com": {"score": 83, "tier": "flag"}, # 80-89% flagged
"michael.torres@harborviewprop.example.com": {"score": 99, "tier": "pass"},
"hr@coastalgroup.example.com": {"score": 71, "tier": "reject"}, # below 80% rejected
"lisa.park@northgatemgmt.example.com": {"score": 91, "tier": "pass"},
"david.kim@cresthaven.example.com": {"score": 88, "tier": "flag"}, # 80-89% flagged
"amanda.ross@stonegatehold.example.com": {"score": 78, "tier": "reject"}, # below 80% rejected
}
PERSONALIZED_EMAILS = {
"sarah.chen@apexpropertygroup.example.com": (
"Hi Sarah,\n\n"
"Saw Apex Property Group is hiring an Office Manager at $65-75K.\n\n"
"We build autonomous systems that handle the heavy lifting — scheduling,\n"
"vendor coordination, data entry — safely in the background.\n\n"
"Quick question: what's the one task eating the most time in your day\n"
"that isn't your actual core work?\n\n"
"Alex Rivera | Acme Solutions\nalex@acmesolutions.example.com"
),
"james.morgan@meridiancr.example.com": (
"Hi James,\n\n"
"Noticed Meridian Capital Realty posted an Operations Coordinator role — $58-68K.\n\n"
"We work with property teams to automate the operational layer that headcount\n"
"usually handles. The kind of work that's critical but doesn't need a full-time\n"
"hire to own it.\n\n"
"What's driving the need — growth volume or a specific bottleneck?\n\n"
"Alex Rivera | Acme Solutions\nalex@acmesolutions.example.com"
),
"michael.torres@harborviewprop.example.com": (
"Hi Michael,\n\n"
"Saw Harborview Properties is searching for a Community Manager at $72-85K.\n\n"
"Operators tell us the same thing: the job is the portfolio. Everything\n"
"else — data entry, scheduling, vendor routing — is overhead eating their day.\n\n"
"We handle the overhead. Want to see the blueprint?\n\n"
"Alex Rivera | Acme Solutions\nalex@acmesolutions.example.com"
),
"lisa.park@northgatemgmt.example.com": (
"Hi Lisa,\n\n"
"Northgate posted a Leasing Coordinator role — saw it this morning.\n\n"
"We automate the leasing pipeline end-to-end: lead capture, follow-up\n"
"sequences, document prep. Same output, a fraction of the overhead.\n\n"
"Worth 10 minutes to walk through how it works for a portfolio your size?\n\n"
"Alex Rivera | Acme Solutions\nalex@acmesolutions.example.com"
),
}
def main():
line()
slow_print("╔══════════════════════════════════════════╗", 0.004)
slow_print("║ B2B OUTBOUND SNIPER v1.0 ║", 0.004)
slow_print("║ Turns hiring signals into pipeline. ║", 0.004)
slow_print("╚══════════════════════════════════════════╝", 0.004)
line()
slow_print(" LLM: anthropic / claude-sonnet-4-20250514")
slow_print(" Sender: smtp (alex@acmesolutions.example.com)")
slow_print(" Vertical: agency")
line()
pause(0.6)
# ── DEDUP GATE ───────────────────────────────────────────────────────────
slow_print("━━━ DEDUP GATE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
pause(0.3)
slow_print(" Fetching existing recipients from campaign...")
pause(0.8)
slow_print(" Dedup gate loaded: 47 existing recipients")
line()
pause(0.5)
# ── SCRAPING ─────────────────────────────────────────────────────────────
slow_print("━━━ SCRAPING ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
pause(0.3)
slow_print("\n Keyword 1/2: 'office manager'")
slow_print(" Starting scrape: 'office manager' in 'NJ'")
slow_print(" Run ID: abc123demo — polling...")
for status in ["RUNNING", "RUNNING", "SUCCEEDED"]:
pause(0.7)
slow_print(f" ... {status}")
slow_print(" ✓ 6 results")
pause(0.4)
slow_print("\n Waiting 5s before next keyword...")
pause(1.0)
slow_print("\n Keyword 2/2: 'operations coordinator'")
slow_print(" Starting scrape: 'operations coordinator' in 'NJ'")
slow_print(" Run ID: def456demo — polling...")
for status in ["RUNNING", "SUCCEEDED"]:
pause(0.7)
slow_print(f" ... {status}")
slow_print(" ✓ 5 results")
line()
slow_print(" Raw results: 11")
line()
pause(0.5)
# ── FILTERING ────────────────────────────────────────────────────────────
slow_print("━━━ FILTERING ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
pause(0.3)
filter_steps = [
(" Normalizing results...", 0.4),
(" ✗ Blocked company: PrideStaff", 0.2),
(" ✗ Blocked domain: poster@indeed.example.com", 0.2),
(" ✗ Dupe (KW-2): sarah.chen@apexpropertygroup.example.com", 0.2),
]
for msg, delay in filter_steps:
slow_print(msg)
pause(delay)
line()
slow_print(" Normalized: 9")
slow_print(" Dupes skipped: 1")
slow_print(" Qualified: 8")
line()
pause(0.5)
# ── VERIFYING ────────────────────────────────────────────────────────────
slow_print("━━━ VERIFYING ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
pause(0.3)
verify_data = [
("sarah.chen@apexpropertygroup.example.com", 97, "pass"),
("james.morgan@meridiancr.example.com", 94, "pass"),
("emily.walsh@summitridgemgmt.example.com", 83, "flag"),
("michael.torres@harborviewprop.example.com", 99, "pass"),
("hr@coastalgroup.example.com", 71, "reject"),
("lisa.park@northgatemgmt.example.com", 91, "pass"),
("david.kim@cresthaven.example.com", 88, "flag"),
("amanda.ross@stonegatehold.example.com", 78, "reject"),
]
for email, score, tier in verify_data:
pause(0.35)
if tier == "pass":
slow_print(f" ✓ {email} — {score}%")
elif tier == "flag":
slow_print(f" ⚠️ {email} — {score}% (flagged for review)")
else:
slow_print(f" ✗ {email} — {score}% (below threshold, skipped)")
line()
slow_print(" 2 leads flagged for manual review (80–89%)")
slow_print(" Flagged leads saved → output/flagged_leads.json")
line()
slow_print(" Verified (≥90%): 4")
slow_print(" Flagged (review): 2")
line()
pause(0.5)
# ── PERSONALIZING ────────────────────────────────────────────────────────
slow_print("━━━ PERSONALIZING ━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
pause(0.3)
personalize_data = [
("Sarah Chen", "Apex Property Group", 0.0048),
("James Morgan", "Meridian Capital Realty", 0.0051),
("Michael Torres","Harborview Properties", 0.0046),
("Lisa Park", "Northgate Real Estate", 0.0049),
]
for name, company, cost in personalize_data:
pause(0.6)
slow_print(f" ✓ {name} @ {company} [${cost:.4f}]")
line()
slow_print(" Personalized: 4")
line()
pause(0.5)
# ── SENDING ──────────────────────────────────────────────────────────────
slow_print("━━━ SENDING ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
pause(0.3)
send_data = [
("sarah.chen@apexpropertygroup.example.com", "Re: Apex Property Group — Office Manager search"),
("james.morgan@meridiancr.example.com", "Re: Meridian Capital Realty — Operations Coordinator search"),
("michael.torres@harborviewprop.example.com", "Re: Harborview Properties — Community Manager search"),
("lisa.park@northgatemgmt.example.com", "Re: Northgate Real Estate — Leasing Coordinator search"),
]
for i, (email, subject) in enumerate(send_data, 1):
pause(0.5)
slow_print(f" ✓ Sent → {email} ({i}/25)")
pause(0.1)
slow_print(f" Subject: {subject}")
line()
pause(0.5)
# ── RESULTS ──────────────────────────────────────────────────────────────
slow_print("━━━ RESULTS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
pause(0.3)
results = [
("Scraped", "11"),
("Qualified", "8"),
("Verified", "4"),
("Personalized", "4"),
("Sent", "4"),
("Flagged", "2"),
("Dupes", "1"),
]
for label, value in results:
slow_print(f" {label:<14}{value}")
pause(0.1)
line()
slow_print(" Cost: $0.0351 / $5.00 — ✓ Within budget")
line()
slow_print(" ✓ Run complete.")
line()
pause(0.5)
if __name__ == '__main__':
main()