Something went wrong. Try again.
Browser extension: detect and subscribe to standard.site publications on ATProto substandard.blog
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596use std::path::PathBuf;
use clap::{Args, Parser, Subcommand};
pub use crate::options::since_cutoff;
#[derive(Debug, Parser)]#[command( name = "longread", version, about = "Find long Bluesky self-threads worth turning into blog posts")]pub struct Cli { #[command(subcommand)] pub command: Command,}
#[derive(Debug, Subcommand)]pub enum Command { /// Rank long self-threads by length and engagement. Scan(ScanArgs), /// Scan the accounts a handle follows and merge the results. Follows(FollowsArgs), /// Write one thread as a Markdown draft. Export(ExportArgs), /// Show a publication's documents and the threads not yet in it. Publication(PublicationArgs),}
#[derive(Debug, Clone, Args)]pub struct ThreadFilter { /// Only read posts newer than this (for example 90d, 12h or 365d). #[arg(long, default_value = "365d")] pub since: String, /// Minimum number of posts in a chain. #[arg(long, default_value_t = 5)] pub min_posts: usize, /// Minimum graphemes of text in a chain. #[arg(long, default_value_t = 1200)] pub min_graphemes: usize, /// Include chains that start as replies to someone else's post. #[arg(long)] pub include_replies: bool, /// Include threads already referenced by a site.standard.document. #[arg(long)] pub include_published: bool,}
#[derive(Debug, Args)]pub struct ScanArgs { /// Handle or DID to scan. pub handle: String, #[command(flatten)] pub filter: ThreadFilter, /// Print JSON instead of a table. #[arg(long)] pub json: bool,}
#[derive(Debug, Args)]pub struct FollowsArgs { /// Handle or DID whose follows to scan. pub handle: String, #[command(flatten)] pub filter: ThreadFilter, /// Maximum number of followed accounts to scan. #[arg(long, default_value_t = 200)] pub limit: usize, /// Print JSON instead of a table. #[arg(long)] pub json: bool,}
#[derive(Debug, Args)]pub struct ExportArgs { /// bsky.app post URL or at-uri of any post in the thread. pub target: String, /// Write to this file instead of stdout. #[arg(long)] pub out: Option<PathBuf>,}
#[derive(Debug, Args)]pub struct PublicationArgs { /// Publication URL or at-uri. pub publication: String, #[command(flatten)] pub filter: ThreadFilter, /// Also scan the owner for threads not already in the publication. #[arg(long)] pub scan: bool, /// Print JSON instead of tables. #[arg(long)] pub json: bool,}