Expand description
MacroMicro 財經 M 平方 adapter — pure-HTTP client for www.macromicro.me.
§Auth model (three independent tokens — keep them straight)
- Cookies (Netscape file):
cf_clearance(Cloudflare bypass),PHPSESSID,mmu,mmt(PHP session + member binding). Thecf_clearancetoken is short-lived (~1h, sometimes a few hours); when it expires, re-export from a logged-in browser visit. App.stk— 32-hex per-session token rendered in the page HTML at<p data-stk="…">(footer). Sent asAuthorization: Bearer <stk>on/charts/data/*and/api/view/chart/*. The client lazily fetches and caches it;error #1165triggers a transparent refresh-and-retry inside the public methods, so callers do not need to orchestrate manual recovery.- JWT from
GET /api/jwt— member token (sub = member id, role =PRO/FREE, exp +1h). Used for other member-gated APIs; NOT the Bearer for chart data.
Plus a custom Docref header echoing the page URL alongside
Referer — both required on chart endpoints.
No browser, no Cloudflare-clearance refresh logic. See http for
the request-shape contract.
Re-exports§
pub use http::normalize_ids;pub use http::MacroMicroClient;pub use types::*;