Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Fairpost

```
tsc && fairpost.js help
```


Ayrshare feed helps you manage your ayrshare
feed from the command line.
Expand All @@ -11,10 +9,28 @@ Each post is a folder, containing at least one
text file (the post body) and optionally images
or a video.


Edit the .env file to manage the platforms
you want to support, amongst others.

## Setting up
```
# install
npm install

# compile typescript code
tsc

# copy and edit config file
cp .env.dist .env && nano .env

# run
./fairpost.js help
```

## Prepare
```
fairpost.js prepare-posts
```
Folders need to be `prepared` (iow turned into posts)
before they can be posted to a platform.
Each platform, as defined in src/platforms, will
Expand All @@ -26,14 +42,20 @@ is youtube). Finally, it will add a json file
describing the post for that platform in the
folder.

The next post can then be `scheduled`, and
any due posts can be `published` :
## Schedule
```
fairpost.js schedule-next-post
```
The next post can then be `scheduled`. For each platform this just updates the json file in one post to set the status to scheduled, and set the schedule date. By default the date will be `FAIRPOST_FEED_INTERVAL` days after the last post for that platform, or `now`, whichever is latest.

## Publish
```
fairpost.js prepare-posts
fairpost.js schedule-next-posts
fairpost.js publish-due-posts
```
This will publish any scheduled posts that are past their due date.


## Arguments

Each of these commands (and others) accept `--arguments`
that may help you, for example, to immediately publish
Expand All @@ -49,7 +71,7 @@ next post automatically.



## cli
## Cli

```
fairpost.js help
Expand All @@ -61,9 +83,9 @@ fairpost.js schedule-next-post [--date=xxxx-xx-xx] [--platforms=xxx,xxx] [--fold
fairpost.js publish-due-posts [--platforms=xxx,xxx] [--folders=xxx,xxx] [--dry-run]
```

## Create a new platform
## Add a new platform

To add support for your own platform, add a class to `src/platforms`
To add support for a new platform, add a class to `src/platforms`
extending `src/classes/Platform`. You want to override at least the
method `preparePost(folder: Folder)` and
`publishPost(post: Post, dryrun:boolean = false)`.
Expand Down
6 changes: 6 additions & 0 deletions feed/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Feed folder

This folder can actually be anywhere, the path
is defined in your `.env` file.

Post your posts here, each in a separate folder.
9 changes: 2 additions & 7 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/*
Usage

```
tsc
node build/index.js ..
```

202309*pike
Fairpost cli handler
*/

import Feed from './src/classes/Feed';
Expand Down
Loading