multiposter
1.0.0An application to post to multiple services at once.
About Multiposter
This is an application that lets you post to multiple web services at once.
How To
While you can use Multiposter from the REPL, it also has a convenient command line interface. To build a binary, simply run sbcl --eval '(asdf:make :multiposter)'
.
The following services are supported:
On the command line you can simply run multiposter
and it should show you a nice help text with all the available options and commands.
Creating New Clients
If you'd like to contribute another client to Multiposter, it's not too hard. Simply create a new client class with define-client
, and ensure all the properties that should be persisted for it are returned from an initargs
method. Then implement methods for the post
, ready-p
and setup
functions.
If your service supports undoing/deleting a post, you should also create a result
subclass and implement the undo
method for it. Your post
methods should then return a result instance on success, such that the post can be removed again later if desired.
For the setup
function, make sure you implement the following logic: if &rest args
are passed, reinitialise your client to use those initargs. Otherwise, if your client is not yet ready-p
, perform an interactive setup using query
to prompt the user for the necessary options.
System Information
Definition Index
-
ORG.SHIRAKUMO.MULTIPOSTER
No documentation provided.-
EXTERNAL SPECIAL-VARIABLE *IMAGE-TYPES*
Variable used to identify pathname-types that correspond to images. See FILE-TYPE-P
-
EXTERNAL SPECIAL-VARIABLE *VIDEO-TYPES*
Variable used to identify pathname-types that correspond to videos. See FILE-TYPE-P
-
EXTERNAL CLASS CLIENT
-
EXTERNAL CLASS DUMMY
Dummy client that doesn't do anything. See CLIENT (type)
-
EXTERNAL CLASS FILE
File client that saves posts to a directory. Each post gets its own txt file. Additional files like images and videos are copied alongside and named similarly to the primary file. The file name is chosen via timestamp and post title. See CLIENT (type)
-
EXTERNAL CLASS GIT
File client that commits to a git repository. This acts like the FILE client, but also makes sure to pull the repository before writing files, and instead of generating a txt file puts the post metadata into the resulting commit instead. After committing it will also push the repository. See FILE (type)
-
EXTERNAL CLASS IMAGE-POST
Post representing a set of images. The number of images allowed is client-specific. The client should automatically trim down the set of files as needed, preferring earlier files. If a client does not support an image type, the client may signal an error or drop the file from the set. If the set becomes empty, an error should be signalled. Each file may also have a description text. If the client does not support file descriptions, the descriptions should be discarded. See FILES See FILE-DESCRIPTIONS See POST (type)
-
EXTERNAL CLASS LICHAT
Client that connects to a Lichat server and posts to a channel. This will split the post content and optional payloads across multiple updates. See CLIENT (type)
-
EXTERNAL CLASS LINK-POST
Post representing a link to another web thing. See URL See POST (type)
-
EXTERNAL CLASS MASTODON
Client that posts to a mastodon server of choice. The post content is truncated automatically to fit within the toot message limit. Tags are filtered to be alphanumeric only. See CLIENT (type) See COMPOSE-POST-TEXT
-
EXTERNAL CLASS MULTIPOSTER
Representation of a multiposter configuration. See DEFAULT-PROFILE See ADD-CLIENT See ADD-PROFILE See FIND-CLIENT See FIND-PROFILE See POST
-
EXTERNAL CLASS POST
Superclass for all post types. See TITLE See HEADER See FOOTER See DESCRIPTION See CONTENT-WARNING See TAGS See COMPOSE-POST
-
EXTERNAL CLASS PROFILE
Representation of a posting profile. A profile encapsulates certain standard tags to add to each post, as well as an optional header and footer to append to each post. You may also set a specific subset of clients to post to when using the profile. When POSTing to a profile, it creates a new post that is augmented with the specified properties of the profile, and then posted to the set of clients the profile is configured for. See NAME See CLIENTS See TAGS See HEADER See FOOTER See POST
-
EXTERNAL CLASS RESULT
Representation of a POST request result. See CLIENT See POST-OBJECT See URL See UNDO See FAILED-P
-
EXTERNAL CLASS STUDIO
Client that uploads to a Studio gallery. This only supports IMAGE-POSTs. If the title is unset, will use the filename of the first file in the image post. See CLIENT (type)
-
EXTERNAL CLASS TEXT-POST
Post representing a text post. The markup language supported is client dependent. The main post text content is the DESCRIPTION field. See DESCRIPTION See POST (type)
-
EXTERNAL CLASS TUMBLR
Client that posts to Tumblr. Tags are filtered to not contain any commas. See CLIENT (type)
-
EXTERNAL CLASS VIDEO-POST
Post representing a video file. If a client does not support a video type, the client should signal an error. See FILE See POST (type)
-
EXTERNAL FUNCTION ALPHANUMERIC-P
- CHAR
Returns T if the character is from the ASCII alphanumeric set.
-
EXTERNAL FUNCTION COMPOSE-POST-TEXT
- HEADER
- BODY
- FOOTER
- &KEY
- TAGS
- TAG-FORMAT
- TAG-SEPARATOR
- CHAR-LIMIT
Compose a single string from the given post parts. Precedence is given to the post parts in the following order: 1. Tags (only whole tags are dropped) 2. Header (trimmed) 3. Footer (trimmed) 4. Body (trimmed) Meaning if the limit is small enough, the post text may be reduced to just tags, or just header and tags, etc.
-
EXTERNAL FUNCTION CONFIG-FILE
Returns the path to the configuration file. If MULTIPOSTER_CONFIG is set, that path is used unquestioningly. Otherwise, if APPDATA or XDG_CONFIG_HOME are set they are used as base directory, and if not, the USER-HOMEDIR-PATHNAME is used as the base directory, within which a directory named "multiposter" is created, and within which a file called "multiposter.lisp" is created.
-
EXTERNAL FUNCTION ENVVAR
- VAR
Returns the value of the given environment variable if it is not empty.
-
EXTERNAL FUNCTION FILE-TYPE-P
- THING
- TYPES
Checks THING against TYPEs and returns T if any match. See *IMAGE-TYPES* See *VIDEO-TYPES*
-
EXTERNAL FUNCTION FILTER-TAGS
- TAGS
- &OPTIONAL
- ALLOWED-CHAR-FUN
Ensures that all tags only contain allowed characters.
-
EXTERNAL FUNCTION LOAD-CONFIG
- &OPTIONAL
- MULTIPOSTER
- FILE
Loads the configuration file and updates the multiposter with it. If MULTIPOSTER is NIL, a new multiposter instance is created and returned. Note that this will not update the *MULTIPOSTER* variable. See CONFIG-FILE See MULTIPOSTER (type)
-
EXTERNAL FUNCTION MERGE-PARAGRAPHS
- &REST
- PARAGRAPHS
Merge multiple paragraphs by inserting two newlines between each. Paragraphs that are NIL or empty strings are ignored. If no paragraphs are passed that aren't ignored, NIL is returned.
-
EXTERNAL FUNCTION NON-COMMA-P
- CHAR
Returns T if the character isn't a comma.
-
EXTERNAL FUNCTION NON-SPACE-P
- CHAR
Returns T if the character isn't a space.
-
EXTERNAL FUNCTION PARSE-TAGS
- TAGS
Parses the given tag or list of tags by splitting each by commas.
-
EXTERNAL FUNCTION PATH-URL
- PATH
Returns a file URL for the given pathname.
-
EXTERNAL FUNCTION QUERY
- PROMPT
- &KEY
- NULLABLE
- DEFAULT
- COERCE
- CHECK
Prompt the user for some information. Returns the entered value. If NULLABLE is T, NIL may be returned. If DEFAULT is given, the DEFAULT is returned if the user does not enter a value. If COERCE is set, the user's value is first run through the COERCE function to convert/parse its type. If CHECK is set, the value is only considered valid if the CHECK function returns true.
-
EXTERNAL FUNCTION SAVE-CONFIG
- &OPTIONAL
- MULTIPOSTER
- FILE
Saves the configuration file. Returns the MULTIPOSTER instance. See CONFIG-FILE See MULTIPOSTER (type)
-
EXTERNAL FUNCTION TIMESTAMP
- &OPTIONAL
- UNIVERSAL-TIME
Returns a "YYYY.MM.DD hh-mm-ss" formatted timestamp string.
-
EXTERNAL FUNCTION TRIM-TEXT
- TEXT
- CHAR-LIMIT
Trims the text smartly to fit within the char limit. If the limit is too low for the text to reasonably fit at all, NIL is returned instead.
-
EXTERNAL FUNCTION VERBOSE
- FORMAT
- &REST
- ARGS
Prints a log message for informational purposes.
-
EXTERNAL GENERIC-FUNCTION ADD-CLIENT
- CLIENT
- MULTIPOSTER
Add a new client to the multiposter. A continuable error is signalled if a client with the same NAME exists already. A continuable error is signalled if the client cannot be readied. See CLIENT (type) See MULTIPOSTER (type)
-
EXTERNAL GENERIC-FUNCTION ADD-PROFILE
- PROFILE
- MULTIPOSTER
Add a new profile to the multiposter. A continuable error is signalled if a client with the same NAME exists already. See PROFILE (type) See MULTIPOSTER (type)
-
EXTERNAL GENERIC-FUNCTION ADD-TAG
- TAG
- POST
Add a tag to the post. The tag is not added if there's an existing tag that matches the new tag regardless of whitespace and case. See POST (type)
-
EXTERNAL GENERIC-FUNCTION CLIENT
- OBJECT
Accesses the client object to which the POST was made. See RESULT (type) See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION (SETF CLIENT)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION CLIENTS
- OBJECT
Accesses the clients associated with the object. For a PROFILE this is a list of CLIENT instances. For a MULTIPOSTER this is a hash table of names to cLIENT instances. See CLIENT (type) See PROFILE (type) See MULTIPOSTER (type)
-
EXTERNAL GENERIC-FUNCTION (SETF CLIENTS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION COMPOSE-POST
- POST
- &REST
- ARGS
- &KEY
- EXCLUDE-TAGS
- EXCLUDE-TITLE
- &ALLOW-OTHER-KEYS
Compose the post content text. This should be used to compose the main post text, especially if the client does not support specific fields for the title or tags. You may pass all arguments permitted by COMPOSE-POST-TEXT. If EXCLUDE-TITLE is true, the title of the post is not included in the text. If EXCLUDE-TAGS is true, the tags list of the post is not included in the text. See COMPOSE-POST-TEXT See POST (type)
-
EXTERNAL GENERIC-FUNCTION CONTENT-WARNING
- OBJECT
Accesses the content-warning description of a post. If set, this will be used as the explanation of why the content in the post should include a warning disclaimer. See POST (type)
-
EXTERNAL GENERIC-FUNCTION (SETF CONTENT-WARNING)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION DEFAULT-PROFILE
- OBJECT
Accesses the default profile to use. If this is NIL, posting to the multiposter will post to all clients. Otherwise it will post to the default profile. See POST See PROFILE (type) See MULTIPOSTER (type)
-
EXTERNAL GENERIC-FUNCTION (SETF DEFAULT-PROFILE)
- PROFILE
- MULTIPOSTER
No documentation provided. -
EXTERNAL GENERIC-FUNCTION DESCRIPTION
- OBJECT
Accesses the main description content of a post. See POST (type)
-
EXTERNAL GENERIC-FUNCTION (SETF DESCRIPTION)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION FAILED-P
- RESULT
Returns true if the result represents a failed post. A failed result cannot be UNDOne. See RESULT (type)
-
EXTERNAL GENERIC-FUNCTION FILE
- OBJECT
Accesses the file of the post. See VIDEO-POST (type)
-
EXTERNAL GENERIC-FUNCTION (SETF FILE)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION FILE-DESCRIPTIONS
- OBJECT
Accesses the file descriptions of a post. This must be a list of the same length of FILES. See FILES See IMAGE-POST (type)
-
EXTERNAL GENERIC-FUNCTION (SETF FILE-DESCRIPTIONS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION FILES
- OBJECT
Accesses the files of a post. See FILE-DESCRIPTIONS See IMAGE-POST (type)
-
EXTERNAL GENERIC-FUNCTION (SETF FILES)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION FIND-CLIENT
- NAME
- MULTIPOSTER
Returns the client of the given name, if any. See PROFILE (type) See MULTIPOSTER (type)
-
EXTERNAL GENERIC-FUNCTION FIND-PROFILE
- NAME
- MULTIPOSTER
Returns the profile of the given name, if any. See PROFILE (type) See MULTIPOSTER (type)
-
EXTERNAL GENERIC-FUNCTION FOOTER
- OBJECT
Accesses the footer of a post. The footer should be a paragraph to be appended after the description. See PROFILE (type) See POST (type)
-
EXTERNAL GENERIC-FUNCTION (SETF FOOTER)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION HEADER
- OBJECT
Accesses the header of a post. The header should be a paragraph to be prepended before the description. See PROFILE (type) See POST (type)
-
EXTERNAL GENERIC-FUNCTION (SETF HEADER)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION INITARGS
- THING
Return a list of initargs for the instance. Users should add methods to this to append initargs that they need to reconstruct the instance.
-
EXTERNAL GENERIC-FUNCTION MAKE-LIKE
- THING
- &REST
- INITARGS
Create a copy of the object but with the given initargs set.
-
EXTERNAL GENERIC-FUNCTION NAME
- OBJECT
Returns the name of the client or profile. See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION (SETF NAME)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION POST
- POST
- CLIENT
- &KEY
- VERBOSE
Post a post to one or more services. If VERBOSE is non-NIL, extra status information may be printed for the user. See POST (type) See CLIENT (type) See MULTIPOSTER (type) See PROFILE (type) See VERBOSE
-
EXTERNAL GENERIC-FUNCTION POST-OBJECT
- OBJECT
Accesses the post object that was posted. Note that due to modifications made to fit the post to the client's requirements, this instance may not be EQ to the POST instance that was passed to the POST function initially. See RESULT (type) See POST (type)
-
EXTERNAL GENERIC-FUNCTION (SETF POST-OBJECT)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION POST-TAGS
- OBJECT
Accessor to the post tags of the client. This should be a list where each element is a list composed of the following elements: POST-TYPE TAG* Where POST-TYPE corresponds to the type of post to which all of the following tags should be added when posting to this client. See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION (SETF POST-TAGS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION READY-P
- CLIENT
Returns true if the CLIENT is ready for posting. See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION SETUP
- CLIENT
- &REST
- ARGS
- &KEY
- PATH
Performs the necessary setup for the CLIENT to become ready. If no ARGS are passed, and the client is not properly configured, an interactive setup should be started to configure the client. If ARGS are passed, the client should be reinitialised with those new arguments. If the configured client is not READY even after the setup, or the configuration is somehow invalid, an error should be signalled. See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION TAGS
- OBJECT
Accesses the tags list of a post. The list of tags should be a set of strings of tags, each of which are distinct from each other. You should add tags via ADD-TAG rather than pushing onto this directly. See ADD-TAG See PROFILE (type) See POST (type)
-
EXTERNAL GENERIC-FUNCTION (SETF TAGS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION TITLE
- OBJECT
Accesses the title of a post. If the client does not support an explicit title field, the title should be treated as a paragraph before the header. See POST (type)
-
EXTERNAL GENERIC-FUNCTION (SETF TITLE)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION UNDO
- RESULT
Undoes the post and deletes it if possible. If this is not possible to do, an error is signalled. See RESULT (type)
-
EXTERNAL GENERIC-FUNCTION URL
- OBJECT
Accesses the remote URL of the resulting post, if any. This may be NIL if the result is a failure. This may be an empty string if there is no canonical URL to access. See RESULT (type)
-
EXTERNAL GENERIC-FUNCTION (SETF URL)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL MACRO DEFINE-CLIENT
- NAME
- DIRECT-SUPERCLASSES
- DIRECT-SLOTS
- &REST
- OPTIONS
Define a new client type. The syntax is identical to DEFCLASS. It will define the class and also register it in the internal system so that it can be easily accessed by the user. See CLIENT (type)
-
EXTERNAL MACRO OR*
- &REST
- VALS
Like OR except that empty strings are treated as NIL.
-