Top100
Your Personal Movie List (C++17 CLI + library)
Loading...
Searching...
No Matches
posting.h
1// SPDX-License-Identifier: Apache-2.0
2//-------------------------------------------------------------------------------
3// Top100 — Your Personal Movie List
4
5// File: lib/posting.h
6// Purpose: Shared helpers to compose and post to BlueSky and Mastodon.
7// Language: C++17 (header)
8//
9// Author: Andy McCall, mailme@andymccall.co.uk
10// Date: September 18, 2025
11//-------------------------------------------------------------------------------
12#pragma once
13
14#include <string>
15#include <optional>
16
17struct Movie;
18struct AppConfig;
19
20// Compose a post body following CLI rules: header, title, director, blank line,
21// plot (possibly truncated with ellipsis), ranking, imdb rating, link, footer.
22// The result will not exceed `limit` UTF-8 code points.
23std::string composePostBody(const AppConfig& cfg, const Movie& m, size_t limit);
24
25// High-level helpers that compose the body and post, including optional poster upload when available.
26bool postMovieToBlueSky(const AppConfig& cfg, const Movie& m);
27bool postMovieToMastodon(const AppConfig& cfg, const Movie& m);
Persistent application configuration stored in a single JSON file.
Definition config.h:39
Movie domain model and metadata.
Definition Movie.h:27