- Claim today’s window
- Professional network
- Short-form network
- Write JSON cache
- Pages stay on the cache
A daily refresh of recent LinkedIn and X posts, saved so public pages can show them. If a connection fails, older posts still show instead of an empty sidebar.
Pulling live social posts on each page view is slow and limited by the networks, and it fails when a login expires. An empty sidebar looks as if the company has gone quiet. Calling both networks while a page loads also adds a delay the reader can feel.
A daily job, which staff can also start from the private admin, collects posts from LinkedIn and X. Each network saves into its own file, and the job skips the run if today's refresh has already happened. Public pages read only the saved posts, and a failed network keeps its previous posts.
Interactive preview with sample data. Nothing is sent to a server.
flowchart LR
Cron["Daily refresh"] --> Claim{"Window free"}
Claim -->|yes| Fetch["Fetch networks"]
Fetch --> Cache["Cache files"]
Fetch --> Stale["Keep previous"]
Cache --> Sidebar["Public sidebar"]