This section describes how to use silo.pub programmatically, including the expected and supported fields for each serivce.
Micropub is an open API standard that describes a protocol for publishing to a personal website. The protocol includes OAuth2-style authorization, using your website's URL as your ID.
silo.pub exposes a micropub endpoint so you can use this protocol and vocabulary to publish to many different hosted services like Blogger and Twitter. If you are POSSEing to many different services, silo.pub might save you the trouble of writing special code for each unique API.
After obtaining an access token, create a new entry on a service by
sending a POST request to silo.pub's Micropub endpoint
(https://silopub.p3k.io/micropub
)
with a x-www-form-urlencoded string (or multipart/form-data if attaching
media). All requests must include the access token either as a form field:
access_token=xxxxxxxxx
or an Authorization header
Authorization: Bearer xxxxxxxxx.
The following sections list the parameters that each service
supports. Most posts will include at least
a content
. Many properties can be multivalued by
specifying e.g. category[]
instead
of category
(note that multi-valued properties must
use the array syntax). Currently only photos and video must be
uploaded as files. In the future we'll support posting media by
URL too. Most properties are optional.
slug | optional custom slug for your post |
name | post title |
content[html] or content | body of the post |
summary | if content is not provided, summary will be used as the body |
in-reply-to | a URL to reply to. This will embed custom microformatted html in the body of your post with class="u-in-reply-to" |
repost-of | at this time, this just embeds a custom microformatted html link in the body of your post with class="repost-of". A planned future version will support native Tumblr reblogging |
like-of | a URL to post an indie like of. This will embed custom microformatted html in the body of your post with class="u-like-of" |
bookmark-of | a URL to post an indie bookmark of. This will embed custom microformatted html in the body of your post with class="u-bookmark-of" |
photo | (file or URL) if provided, creates a "photo" post with a caption based on content (or name or summary) |
slug | optional custom slug for your post |
name | post title |
summary | passed to Wordpress as the "excerpt" |
content[html] or content | body of the post |
in-reply-to | a URL to reply to. This will embed custom microformatted html in the body of your post with class="u-in-reply-to" |
repost-of | at this time, this just embeds a custom microformatted html link in the body of your post with class="repost-of" |
like-of | a URL to post an indie like of. This will embed custom microformatted html in the body of your post with class="u-like-of" |
bookmark-of | a URL to post an indie bookmark of. This will embed custom microformatted html in the body of your post with class="u-bookmark-of" |
photo | (file or URL) uploads a single photo as an attachment using the
Wordpress property media |
name | post title |
content[html] or content | body of the post |
in-reply-to | a URL to reply to. This will embed custom microformatted html in the body of your post with class="u-in-reply-to" |
repost-of | at this time, this just embeds a custom microformatted html link in the body of your post with class="repost-of" |
like-of | a URL to post an indie like of. This will embed custom microformatted html in the body of your post with class="u-like-of" |
bookmark-of | a URL to post an indie bookmark of. This will embed custom microformatted html in the body of your post with class="u-bookmark-of" |
url | Permalink of the original post, useful for syndicating to Twitter. If the content must be truncated to fit in a tweet, this link will be appended. Otherwise, it is ignored. |
name | title of an article. If provided, this supersedes the content,
and implies a different formatting: "Article Title: url".
Unlike the note case, url will be included even if the
name is much shorter than the character limit. |
content[value] or content | text of the note. If this is longer than 280 characters
(assuming t.co wrapping), silo.pub will automatically truncate
the content and include url (if provided) |
in-reply-to | URL of a tweet to reply to. Use in-reply-to[] to pass multiple values — We'll use the first one that looks like a tweet permalink. |
location | A Geo URI specifying latitude and longitude,
e.g. geo:37.7458887,-119.5333317 . (additional
properties of the URI are ignored). |
photo | (file or URL) Attach a photo to the tweet. Up to 4 photos can be
attached using the array syntax
(photo[] ). Twitter documentation says images can
be up to 5MB, but it seems to complain about anything over
3MB. |
video | (file) Attach a single video to the tweet. The video must be in MP4 format and can be up to 15MB. |
repost-of | URL of a tweet to retweet. If specified, all other fields are ignored. Multiple values are allowed with repost-of[] — We'll use the first one that looks like a tweet permalink. |
like-of | URL of a tweet to like. If specified, all other fields are ignored. Multiple values are allowed with like-of[] — We'll use the first one that looks like a tweet permalink. |
name | title of an article. If name and content are provided, then silo.pub will post the full text. Note that "name" and "photo" are mutually exclusive (because articles are not photos) — If "name" is specified, then "photo" is ignored. |
content[value] or content | text of the post. For note posts, silo.pub grabs the first link from the post content (if there are any) and uses it as the link preview. |
url | Permalink of the original post, useful when syndicating to Facebook. If this looks like an "article" (i.e. it has an explicit "name") then the permalink will be included as a link preview. If this looks more like a "note", then it will be included in parentheses in the body of the status update. |
location | Either a numeric Facebook place ID or a Geo URI expressing latitude and longitude. Given a lat/long, we'll searh Facebook for places near this point. If we fails to find a match in the Facebook database, publishing will proceed normally, without a place. |
place-name | Use this name to narrow down the search for a Facebook place. It doesn't have to be an exact match for the name in the Facebook database, but an overly specific name might prevent the API from finding anything. |
photo | (file or URL) If provided, post a photo. content
will become the photo's "caption". name is
ignored. |
video | (file) If provided, post a video. name will
be the title, and content will be the description
(note the difference with photos, which have only a caption).
|
name | Photo title |
content[value] or content | Photo description (optional) |
photo | (file or URL) required unless video is provided. This is the photo to upload to Flickr. |
video | (file or URL) This is a video to upload to Flickr. |
category | One or more tags to apply to the photo. If a category is
the URL to a user's profile or photostream, then this will
be converted to
a person
tag instead of a regular tag. To specify multiple
categories, remember to use the array
syntax, category[]= .
|
location | a Geo URI specifying the latitude and longitude where the
photo was taken, e.g. geo:39.3085532,-123.8105919 . |
content[value] or content | Text of the comment |
in-reply-to | URL of the photo on which to comment. |
like-of | URL of the photo to favorite. |
in-reply-to | the GitHub repository URL (the repository plus /issues is also accepted) |
name | Plain-text title of the issue. Try to keep these around 50 characters |
content[markdown] content[value] or content |
Markdown description of the issue. |
category | One or more labels to apply to the issue (note that only
project committers can apply labels. Remember to use
the category[] syntax to apply multiple
labels. |
in-reply-to | the GitHub issue or pull request URL (e.g. https://github.com/kylewm/issues/1) |
content[markdown] content[value] or content |
Markdown-formatted content of the comment. |
like-of | the GitHub repository URL |
item | The Goodreads URL, ISBN number, or simply the title (with or without author) of the book. We'll pull the Goodreads ID from the URL if it's given, or otherwise use the Goodreads search API to find the book. |
description[value] or description or content[value] or content or summary or name |
Optional. A descriptive review of the book. |
rating | Optional. A rating 1 to 5, where 5 is the highest rating. |
category | One or more shelves to add this book to. Shelves that do not already exist for this user will be ignored. |