SASMA — New Car Arrivals to Approved Social Posts by Omar ShammaSASMA — New Car Arrivals to Approved Social Posts by Omar Shamma

SASMA — New Car Arrivals to Approved Social Posts

Omar Shamma

Omar Shamma

The problem

Supreme Automotive is a used-car dealership in Connecticut, moving inventory across cars, SUVs, trucks and motorcycles. Every car that landed on the lot needed a video and platform-tuned captions to go out on Facebook, Instagram and TikTok, and that content only existed if someone manually shot it, wrote it and posted it — car by car, every time. That doesn't scale against a lot that turns over constantly, and it meant marketing output was capped by however much time a human had that day, not by how many cars actually arrived.

What I built

I designed and shipped SASMA (Supreme Automotive Social Media Agent) — a pipeline that watches the dealership's own website inventory feed, and for every genuinely new arrival downloads the photos, scrapes the price, writes captions for each platform, renders a branded 9:16 voiceover video, and sends the whole package to a Telegram group for a one-tap Approve or Reject. On approval it publishes straight to Facebook and Instagram through their native APIs, and hands back a ready-to-paste Facebook Marketplace block plus a photo album, since Marketplace has no listing API at all. I built this end to end: the feed poller, the dedup layer, the renderer, the local voice-cloning service, the Telegram approval bot and the publishing layer, and I run it as a dedicated, isolated Docker stack.

How it works

The trigger is the dealership's own RSS inventory feed, polled on a schedule. Each item carries year, make, model, trim, VIN, engine, transmission, mileage and roughly eight photo URLs — but not price. I close that gap with a plain HTTP fetch of the listing page and a regex against the site's price field, no headless browser needed. New cars are tracked against already-seen ones in a SQLite table keyed by VIN, with explicit statuses (seeded, pending_review, approved, rejected, skipped_no_photos) so nothing posts twice and the existing back-catalogue was seeded once, silently, before the pipeline ever went live.
For each new car I build a seven-scene voiceover script and render it with a renderer I wrote that composes each scene as a still — real car photo, blurred background, brand overlay — with ffmpeg's zoompan for a Ken Burns pan. It generates the video and audio as two independent continuous streams, with each scene's clip length set to exactly match its own voiceover clip, then muxes them once at the end. That avoids the audio/video drift you get from concatenating separately-muxed clips. Numbers are spelled out as words before they hit the TTS engine, so prices, mileage and engine displacement read as natural speech instead of digit-by-digit. The voice is a locally hosted clone running on a GPU service, which I migrated to after starting on a paid template API whose AI b-roll distorted the actual car — a non-starter for a real listing. If the cloned voice fails, the render is deliberately aborted rather than shipping a wrong-voice video; the car gets flagged and is recoverable with a retry command.
Approval runs through a Telegram bot I built to own its own long-poll rather than a webhook, so it works with no public URL. Every review message carries a single-use nonce, so a stale or replayed button tap is rejected, and a second tap on an already-processing car is ignored by an idempotency guard — nothing can double-publish. On approve, the video uploads to object storage for a public URL, then posts to Facebook through the Reels Publishing API's three-phase start/upload/finish flow rather than the plain video endpoint, and to Instagram through its container-based publish flow. TikTok is wired the same way but stays credential-gated behind its platform audit. Because Marketplace has no listing API and no way to attach video, the agent auto-assembles a copy-paste listing block and a one-tap photo album so the owner pastes rather than types.

Outcome

SASMA is live and production-ready. The pipeline runs on a 45-minute poll cycle, renders new arrivals automatically, and posts to Facebook and Instagram on owner approval — both verified live with real posts. TikTok publishing is built and credential-gated, pending its platform audit. I also built a portable single-machine deployment: a PowerShell installer that checks for Docker and GPU support, builds the two-container stack and seeds existing inventory, so the whole system can be handed off and run independently of my own machine.

Stack

Python · Docker Compose · n8n · SQLite · ffmpeg · Pillow · GPU voice cloning · PyTorch · Telegram Bot API · Facebook Graph API (Reels) · Instagram Graph API · object storage · PowerShell
Like this project

Posted Aug 6, 2026

I built SASMA, an agent that turns a dealership's new car arrivals into rendered videos, captions, and approved posts on Facebook and Instagram.