The multiposter Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The multiposter Reference Manual

This is the multiposter Reference Manual, version 1.1.0, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Mon Jul 29 16:17:56 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

About Multiposter

This is a protocol and small application to allow posting content to multiple providers at once.

How To

Load the providers you want:

(ql:quickload '(multiposter-twitter multiposter-mastodon multiposter-tumblr multiposter-studio multiposter-git))

And set them up:

(multiposter:setup)

This will prompt you for a bunch of information for each client. By default it will create a client for each type that you loaded.

It's necessary to note that one client (potentially at random) will be picked as the "primary" client. This means that a post on every other client will contain a link to the post of the primary client. If you would like to set another client to be the primary, you can pass a different list:

(multiposter:setup :clients '(multiposter-tumblr:client multiposter-twitter:client ..))

The first one in the list will be picked as the primary. If you do not want any primary at all, you can set it to NIL explicitly.

(setf (multiposter:primary multiposter:*client*) NIL)

When you set the client up, it will automatically persist all the necessary login information to a configuration file at *config-path*. In future sessions, you can simply call restore to get the settings back.

To actually post to the configured services, simply call one of the related functions, text link image video:

(multiposter:image #p"~/meat.jpg" :description "Some meat." :tags '("meat"))

And that's pretty much it. Note that for services that do not support tags as metadata, or enforce limits on the textual content, Multiposter will attempt to be as smart as possible and shorten or convert things in a sensible manner. It is for this reason too that using a primary client that does not restrict things is a good idea.

Creating New Clients

If there's an additional service you would like to add support for, you can make use of Multiposter's posting protocol. The first step is to create a subclass of client.

(defclass client (multiposter:client) ())

Next you will need a method on make-load-form. This is used to persist the client's settings.

(defmethod make-load-form ((client client) &optional env)
  (declare (ignore env))
  `(make-instance 'client ...))

Another important part of the protocol is the login function, which takes care of the authentication during the initial setup. The function accepts arbitrary keywords, which you should use to allow the user to potentially provide default values. For anything that is not specified, use prompt to ask the user interactively.

(defmethod multiposter:login ((client client) &key some-prop)
  (let ((some-prop (or some-prop (multiposter:prompt "Please enter some prop"))))
    (setf (some-prop client) some-prop)
    ...))

Finally you'll need methods on post-text, post-link, post-image, and post-video that perform the actual posting. You should take care to post as much of the provided information as possible and to only cut content if necessary.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 multiposter

Maintainer

Nicolas Hafner <shinmera@tymoon.eu>

Author

Nicolas Hafner <shinmera@tymoon.eu>

Home Page

https://Shinmera.github.io/multiposter/

Source Control

(:git "https://github.com/shinmera/multiposter.git")

Bug Tracker

https://github.com/Shinmera/multiposter/issues

License

zlib

Description

A small application to post to multiple services at once.

Version

1.1.0

Dependencies
Source

multiposter.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 multiposter.asd

Location

multiposter.asd

Systems

multiposter (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 multiposter/package.lisp

Parent

multiposter (system)

Location

package.lisp

Packages

multiposter


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 multiposter/toolkit.lisp

Dependency

package.lisp (file)

Parent

multiposter (system)

Location

toolkit.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 multiposter/interface.lisp

Dependency

toolkit.lisp (file)

Parent

multiposter (system)

Location

interface.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.5 multiposter/protocol.lisp

Dependency

interface.lisp (file)

Parent

multiposter (system)

Location

protocol.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.6 multiposter/documentation.lisp

Dependency

protocol.lisp (file)

Parent

multiposter (system)

Location

documentation.lisp


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 multiposter

Source

package.lisp (file)

Nickname

org.shirakumo.multiposter

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *client*

This variable keeps the current client instance for convenient posting.

See CLIENT
See RESTORE
See OFFLOAD
See SETUP
See TEXT
See LINK
See IMAGE
See VIDEO

Package

multiposter

Source

interface.lisp (file)

Special Variable: *config-path*

This variable holds the default path for the configuration file.

If XDG_CONFIG_HOME is set, it is: XDG_CONFIG_HOME/multiposter/client.lisp
If the system is Windows, it is: ~/AppData/Local/multiposter/client.lisp
Otherwise, it is:
~/.config/multiposter/client.lisp

Package

multiposter

Source

interface.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: client-types ()

Returns a list of known subclasses of CLIENT.

See CLIENT
See SETUP

Package

multiposter

Source

protocol.lisp (file)

Extracts all the links from the text.

This returns a list of the following structure:

PARTS ::= PART*
PART ::= string | LINK
LINK ::= (:link string)

This is useful for systems where links are transformed independent of the rest of the text. Only HTTP/S links are recognised, but the protocol can be absent from a link.

Package

multiposter

Source

toolkit.lisp (file)

Function: image PATH &key CLIENT TITLE DESCRIPTION TAGS LINK

Shorthand to post a new image.

See POST-IMAGE
See *CLIENT*

Package

multiposter

Source

interface.lisp (file)

Truncate the length of a text intelligently.

This is useful for services where links are shortened and thus do not constitute the full length to the text’s length. The returned string should not contain any truncated links. If a truncation must happen, it will cut before the last character or newline if this character is no farther than CUTOFF many characters from the necessary end of the string.

This heuristic is not perfect, especially in a multilingual context, but it should provide a good effort.

See EXTRACT-LINKS

Package

multiposter

Source

toolkit.lisp (file)

Shorthand to post a new link.

See POST-LINK
See *CLIENT*

Package

multiposter

Source

interface.lisp (file)

Function: offload &optional PATH CLIENT

Save the client to the configuration file.

Simply writes the client’s make-load-form to the file. Returns the client.

See *CLIENT*
See *CONFIG-PATH*

Package

multiposter

Source

interface.lisp (file)

Function: prompt PROMPT &key CONVERTER DEFAULT STREAM

Prompt the user for some information.

Writes a prompt for PROMPT to the given stream, defaulting to *QUERY-IO*. It then reads a line from this same stream. If a DEFAULT is given, and the line is empty, then the default is returned. Otherwise, the CONVERTER is called with the line. If the converter signals an error, the error is written to the stream and the user is asked again. Otherwise, the value returned by the converter is returned.

By default a converter is used that simply checks that the string is not empty.

Package

multiposter

Source

toolkit.lisp (file)

Function: restore &optional PATH

Load the client from the configuration file.

Simply LOADs the given path if it exists and returns *client*.

See *CLIENT*
See *CONFIG-PATH*

Package

multiposter

Source

interface.lisp (file)

Function: setup &key CLIENTS PATH

Constructs a new multiposter client and performs a login.

On successful login, the client is OFFLOADed, the *CONFIG-PATH* and *CLIENT* variables are set, and the client is returned. The clients list can be a list of class names, class instances, or CLIENT instances. The first client in the list is picked as the multiposter client’s primary client.

See CLIENT-TYPES
See LOGIN
See OFFLOAD
See *CLIENT*
See *CONFIG-PATH*

Package

multiposter

Source

interface.lisp (file)

Function: text TEXT &key CLIENT TAGS LINK TITLE

Shorthand to post a new text update.

See POST-TEXT
See *CLIENT*

Package

multiposter

Source

interface.lisp (file)

Function: video PATH &key CLIENT TITLE DESCRIPTION TAGS LINK

Shorthand to post a new video.

See POST-VIDEO
See *CLIENT*

Package

multiposter

Source

interface.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Generic functions

Generic Function: clients OBJECT

Accessor to the list of client instances in the multiposter.

See MULTIPOSTER

Package

multiposter

Writer

(setf clients) (generic function)

Methods
Method: clients (MULTIPOSTER multiposter)

automatically generated reader method

Source

protocol.lisp (file)

Generic Function: (setf clients) NEW-VALUE OBJECT
Package

multiposter

Reader

clients (generic function)

Methods
Method: (setf clients) NEW-VALUE (MULTIPOSTER multiposter)

automatically generated writer method

Source

protocol.lisp (file)

Generic Function: login CLIENT &key &allow-other-keys

Performs the login and setup sequence for the given client.

The client may specify custom keyword arguments that can be used to provide default settings. Any missing settings will be interactively queries from the user.

Returns the client instance on success.
Must signal an error on failure.

See CLIENT

Package

multiposter

Source

protocol.lisp (file)

Methods
Method: login (MULTIPOSTER multiposter) &rest ARGS
Generic Function: post CLIENT THING &key TITLE DESCRIPTION TAGS LINK

Post a thing using the given client.

By default this delegates to the specific functions based on a heuristic analysis of the thing.

See POST-TEXT
See POST-LINK
See POST-IMAGE
See POST-VIDEO
See *IMAGE-TYPES*
See *VIDEO-TYPES*
See EXTRACT-LINKS

Package

multiposter

Source

protocol.lisp (file)

Methods
Method: post CLIENT (THING string) &key TITLE DESCRIPTION TAGS LINK
Method: post CLIENT (PATH pathname) &key TITLE DESCRIPTION TAGS LINK
Method: post (CLIENT (eql t)) THING &rest ARGS
Source

interface.lisp (file)

Generic Function: post-image CLIENT PATH &key TITLE DESCRIPTION TAGS LINK

Posts a new image update to the client.

Depending on the client the text may contain markup and links. Depending on the client the description or tags might be cut short. If LINK is provided, the update must include the full link.

See CLIENT

Package

multiposter

Source

protocol.lisp (file)

Methods
Method: post-image (MULTIPOSTER multiposter) PATH &rest ARGS
Generic Function: post-link CLIENT URL &key TITLE DESCRIPTION TAGS

Posts a new link update to the client.

Depending on the client the text may contain markup and links. Depending on the client the description or tags might be cut short.

See CLIENT

Package

multiposter

Source

protocol.lisp (file)

Methods
Method: post-link (MULTIPOSTER multiposter) URL &rest ARGS
Generic Function: post-text CLIENT TEXT &key TAGS LINK

Posts a new textual update to the client.

Depending on the client the text may contain markup and links. Depending on the client the text or tags might be cut short. If LINK is provided, the update must include the full link.

See CLIENT

Package

multiposter

Source

protocol.lisp (file)

Methods
Method: post-text (MULTIPOSTER multiposter) TEXT &rest ARGS
Generic Function: post-video CLIENT PATH &key TITLE DESCRIPTION TAGS LINK

Posts a new image update to the client.

Depending on the client the text may contain markup and links. Depending on the client the description or tags might be cut short. If LINK is provided, the update must include the full link.

See CLIENT

Package

multiposter

Source

protocol.lisp (file)

Methods
Method: post-video (MULTIPOSTER multiposter) PATH &rest ARGS
Generic Function: primary OBJECT

Accessor to the primary client of the multiposter.

See MULTIPOSTER

Package

multiposter

Writer

(setf primary) (generic function)

Methods
Method: primary (MULTIPOSTER multiposter)

automatically generated reader method

Source

protocol.lisp (file)

Generic Function: (setf primary) NEW-VALUE OBJECT
Package

multiposter

Reader

primary (generic function)

Methods
Method: (setf primary) NEW-VALUE (MULTIPOSTER multiposter)

automatically generated writer method

Source

protocol.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Classes

Class: client ()

Superclass for all clients that can post using this protocol.

Clients must implement methods for the following functions: LOGIN POST-TEXT POST-LINK POST-IMAGE POST-VIDEO

See CLIENT-TYPES
See LOGIN
See POST
See POST-TEXT
See POST-LINK
See POST-IMAGE
See POST-VIDEO

Package

multiposter

Source

protocol.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses

multiposter (class)

Class: multiposter ()

Base class for the aggregation of multiple clients into one.

Simply delegates the posting functions to the respective clients and makes sure that each client refers to the post of the primary client if a primary client has been set.

See CLIENT
See PRIMARY
See CLIENTS

Package

multiposter

Source

protocol.lisp (file)

Direct superclasses

client (class)

Direct methods
Direct slots
Slot: clients
Initargs

:clients

Readers

clients (generic function)

Writers

(setf clients) (generic function)

Slot: primary
Initargs

:primary

Readers

primary (generic function)

Writers

(setf primary) (generic function)

Direct Default Initargs
InitargValue
:clientsnil
:primarynil

Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *image-types*

Holds a list of known pathname types that designate image files.

By default:
png jpg jpeg gif bmp svg

Package

multiposter

Source

protocol.lisp (file)

Special Variable: *url-regex*
Package

multiposter

Source

toolkit.lisp (file)

Special Variable: *video-types*

Holds a list of known pathname types that designate video files:

By default:
gifv apng mp4 webm mov mkv

Package

multiposter

Source

protocol.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: delegate-to MULTIPOSTER FUNCTION PRIMARY ARGS
Package

multiposter

Source

protocol.lisp (file)

Function: not-empty-converter INPUT
Package

multiposter

Source

toolkit.lisp (file)

Function: prefix-multiline PREFIX STRING
Package

multiposter

Source

toolkit.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M  
Index Entry  Section

F
File, Lisp, multiposter.asd: The multiposter<dot>asd file
File, Lisp, multiposter/documentation.lisp: The multiposter/documentation<dot>lisp file
File, Lisp, multiposter/interface.lisp: The multiposter/interface<dot>lisp file
File, Lisp, multiposter/package.lisp: The multiposter/package<dot>lisp file
File, Lisp, multiposter/protocol.lisp: The multiposter/protocol<dot>lisp file
File, Lisp, multiposter/toolkit.lisp: The multiposter/toolkit<dot>lisp file

L
Lisp File, multiposter.asd: The multiposter<dot>asd file
Lisp File, multiposter/documentation.lisp: The multiposter/documentation<dot>lisp file
Lisp File, multiposter/interface.lisp: The multiposter/interface<dot>lisp file
Lisp File, multiposter/package.lisp: The multiposter/package<dot>lisp file
Lisp File, multiposter/protocol.lisp: The multiposter/protocol<dot>lisp file
Lisp File, multiposter/toolkit.lisp: The multiposter/toolkit<dot>lisp file

M
multiposter.asd: The multiposter<dot>asd file
multiposter/documentation.lisp: The multiposter/documentation<dot>lisp file
multiposter/interface.lisp: The multiposter/interface<dot>lisp file
multiposter/package.lisp: The multiposter/package<dot>lisp file
multiposter/protocol.lisp: The multiposter/protocol<dot>lisp file
multiposter/toolkit.lisp: The multiposter/toolkit<dot>lisp file

Jump to:   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
C   D   E   F   G   I   L   M   N   O   P   R   S   T   V  
Index Entry  Section

(
(setf clients): Exported generic functions
(setf clients): Exported generic functions
(setf primary): Exported generic functions
(setf primary): Exported generic functions

C
client-types: Exported functions
clients: Exported generic functions
clients: Exported generic functions

D
delegate-to: Internal functions

E
extract-links: Exported functions

F
Function, client-types: Exported functions
Function, delegate-to: Internal functions
Function, extract-links: Exported functions
Function, image: Exported functions
Function, limit-text-with-links: Exported functions
Function, link: Exported functions
Function, not-empty-converter: Internal functions
Function, offload: Exported functions
Function, prefix-multiline: Internal functions
Function, prompt: Exported functions
Function, restore: Exported functions
Function, setup: Exported functions
Function, text: Exported functions
Function, video: Exported functions

G
Generic Function, (setf clients): Exported generic functions
Generic Function, (setf primary): Exported generic functions
Generic Function, clients: Exported generic functions
Generic Function, login: Exported generic functions
Generic Function, post: Exported generic functions
Generic Function, post-image: Exported generic functions
Generic Function, post-link: Exported generic functions
Generic Function, post-text: Exported generic functions
Generic Function, post-video: Exported generic functions
Generic Function, primary: Exported generic functions

I
image: Exported functions

L
limit-text-with-links: Exported functions
link: Exported functions
login: Exported generic functions
login: Exported generic functions

M
Method, (setf clients): Exported generic functions
Method, (setf primary): Exported generic functions
Method, clients: Exported generic functions
Method, login: Exported generic functions
Method, post: Exported generic functions
Method, post: Exported generic functions
Method, post: Exported generic functions
Method, post-image: Exported generic functions
Method, post-link: Exported generic functions
Method, post-text: Exported generic functions
Method, post-video: Exported generic functions
Method, primary: Exported generic functions

N
not-empty-converter: Internal functions

O
offload: Exported functions

P
post: Exported generic functions
post: Exported generic functions
post: Exported generic functions
post: Exported generic functions
post-image: Exported generic functions
post-image: Exported generic functions
post-link: Exported generic functions
post-link: Exported generic functions
post-text: Exported generic functions
post-text: Exported generic functions
post-video: Exported generic functions
post-video: Exported generic functions
prefix-multiline: Internal functions
primary: Exported generic functions
primary: Exported generic functions
prompt: Exported functions

R
restore: Exported functions

S
setup: Exported functions

T
text: Exported functions

V
video: Exported functions

Jump to:   (  
C   D   E   F   G   I   L   M   N   O   P   R   S   T   V  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
C   P   S  
Index Entry  Section

*
*client*: Exported special variables
*config-path*: Exported special variables
*image-types*: Internal special variables
*url-regex*: Internal special variables
*video-types*: Internal special variables

C
clients: Exported classes

P
primary: Exported classes

S
Slot, clients: Exported classes
Slot, primary: Exported classes
Special Variable, *client*: Exported special variables
Special Variable, *config-path*: Exported special variables
Special Variable, *image-types*: Internal special variables
Special Variable, *url-regex*: Internal special variables
Special Variable, *video-types*: Internal special variables

Jump to:   *  
C   P   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   M   P   S  
Index Entry  Section

C
Class, client: Exported classes
Class, multiposter: Exported classes
client: Exported classes

M
multiposter: The multiposter system
multiposter: The multiposter package
multiposter: Exported classes

P
Package, multiposter: The multiposter package

S
System, multiposter: The multiposter system

Jump to:   C   M   P   S