How kiryano/scout works
Purpose and Entry Point
Scout is a Python 3.10+ interactive CLI for lead generation. It collects public profile data from social platforms, enriches records with contact information and email confidence, then exports leads to CSV. The executable orchestration point is scout.py; package code begins at app/__init__.py.
CLI Orchestration
scout.py owns command-line modes (--verbose, help, version), interactive user flow, bulk-input handling, scraper selection, enrichment invocation, and CSV export. It is the control-plane boundary between operator input and the scraping/enrichment pipeline.
Platform Scraper Layer
Platform-specific adapters normalize disparate profile pages and APIs into a consistent lead representation. Each scraper encapsulates authentication requirements, platform requests, extraction, and platform-specific fallback behavior.
• app/scrapers/instagram.py
• app/scrapers/linkedin.py
• app/scrapers/github.py
• app/scrapers/youtube.py
• app/scrapers/tiktok.py
• app/scrapers/twitch.py
• app/scrapers/pinterest.py
LinkedIn is the principal authenticated boundary: it consumes the LINKEDIN_COOKIE session value. GitHub may encounter unauthenticated API rate limits.
Link-in-Bio Discovery
app/scrapers/linktree.py expands a profile’s bio/link-in-bio URL into downstream social, website, messaging, and contact links. It supports Linktree plus related link-page providers, making it a fan-out stage between initial social discovery and website/contact enrichment.
Enrichment Pipeline
app/scrapers/enrichment.py transforms normalized scraped profiles into enriched leads. The sequence is: extract direct emails/phones from profile text; crawl the associated website and likely contact/about pages; infer company identity from profile text; resolve potential company domains through DNS/MX signals; derive email naming patterns; generate candidates; SMTP-verify candidates; assign source/verification-based confidence and lead score.
Optional Hunter.io support supplements the otherwise self-hosted DNS and SMTP approach.
Request Evasion and Network Boundary
app/scrapers/stealth.py and app/scrapers/utils.py provide shared HTTP behavior across scrapers, including user-agent rotation, request pacing, proxy selection, and extraction utilities. Network traffic crosses multiple unreliable or defended external services: social sites, profile APIs, arbitrary linked websites, DNS resolvers, and recipient SMTP servers.
• app/scrapers/stealth.py
• app/scrapers/utils.py
Proxy behavior is environment-driven: a single proxy, rotating proxy-file pool, or free proxy mode can be used; Twitch can fall back to direct connectivity when a proxy fails.
Data Boundaries and Outputs
The pipeline’s central data contract is the consistent profile/lead object passed from platform adapters to enrichment and then to CSV export under CLI control. Credentials and network settings remain externalized through environment variables, represented by .env.example; proxy pool input is represented by proxies.example.txt. No web-server or dashboard runtime exists in this repository; the operational runtime is the local Python CLI.
Main entry points: enrichment.py Enrichment pipeline · scout.py Scout CLI · stealth.py Stealth HTTP · linkedin.py LinkedIn scraper
Components 19
CLI Runtime
Local operator-facing control plane.
- Scout CLI · Interactive modes, bulk flow, scraper selection, enrichment, and CSV export.
scout.py - Application package
app/__init__.py - Normalized profile / lead · Shared record passed from adapters through enrichment to export.
- CSV export
Profile Acquisition
Platform adapters and shared request behavior.
- Platform scrapers · Normalizes platform profiles and encapsulates platform-specific fallbacks.
- Instagram scraper
app/scrapers/instagram.py - LinkedIn scraper · Uses the LINKEDIN_COOKIE session value.
app/scrapers/linkedin.py - Other platform adapters · GitHub, YouTube, TikTok, Twitch, and Pinterest acquisition.
app/scrapers/github.py - Link-in-bio discovery · Expands Linktree and related link pages into websites and contact links.
app/scrapers/linktree.py - Stealth HTTP · User-agent rotation, pacing, and proxy selection.
app/scrapers/stealth.py - Request & extraction utilities
app/scrapers/utils.py
Lead Enrichment
Website, domain, and email resolution stages.
- Enrichment pipeline · Coordinates contact extraction, website crawling, domain resolution, and scoring.
app/scrapers/enrichment.py - Website contact crawl · Crawls associated sites plus likely contact and about pages.
- Domain & email resolution · Uses DNS/MX, naming patterns, candidate generation, and SMTP verification.
External Boundaries
Unreliable third-party services and operator-provided inputs.
- Social platforms & APIs · Profile pages and APIs, including rate-limited or defended endpoints.
- Websites, DNS & SMTP · Linked websites, DNS resolvers, and recipient mail servers.
- Environment credentials · Credentials and network settings, including proxy modes.
.env.example - Proxy pool input · Optional rotating proxy-file source.
proxies.example.txt - Hunter.io
Connections 23
- Scout CLI → Application package: loads
- Scout CLI → Platform scrapers: selects
- Platform scrapers → Instagram scraper: includes
- Platform scrapers → LinkedIn scraper: includes
- Platform scrapers → Other platform adapters: includes
- Platform scrapers → Normalized profile / lead: normalizes into
- Platform scrapers → Link-in-bio discovery: expands bio links
- Platform scrapers → Stealth HTTP: uses
- Platform scrapers → Request & extraction utilities: uses
- Stealth HTTP → Environment credentials: reads settings
- Stealth HTTP → Proxy pool input: rotates from
- Stealth HTTP → Social platforms & APIs: requests
- LinkedIn scraper → Environment credentials: reads cookie
- Link-in-bio discovery → Websites, DNS & SMTP: discovers links on
- Scout CLI → Enrichment pipeline: invokes
- Normalized profile / lead → Enrichment pipeline: enriches
- Enrichment pipeline → Website contact crawl: crawls
- Website contact crawl → Websites, DNS & SMTP: fetches
- Enrichment pipeline → Domain & email resolution: resolves
- Domain & email resolution → Websites, DNS & SMTP: queries and verifies
- Enrichment pipeline → Hunter.io: optionally supplements
- Enrichment pipeline → Normalized profile / lead: adds confidence and score
- Scout CLI → CSV export: writes leads