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
104 changes: 62 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@ Fairpost helps you manage users social media feeds from a single
entry point, using Node. It supports Facebook, Instagram,
Reddit, Twitter, YouTube and LinkedIn.

A Feed is just a folder on disk, and all subfolders are Posts,
A Feed is just a folder on disk, and all subfolders are Source Posts,
containing at least one text file (the post body) and
optionally images or video.
optionally images or video. The Source Post will be transformed
into real posts for each connected platform.

Fairpost is *opinionated*, meaning, it will decide
how a folder with contents can best be presented
as a post on each platform.
how a Source Post with contents can best be presented
as a Post on each platform.

By default there is one user with a feed located in `./feed`.
Read [Set up for multiple users](./docs/MultipleUsers.md)
on how to set it up for more users.
For each platform, you'll have to register the app on the
platform. This usually results in an AppId and AppSecret or
something similar, which should be stored in global config.

Edit `.env` to manage the platforms
you want to support, the interval for new posts,
etcetera. For each platform, you'll have to
register the app to post on the users behalf.
Then for each user, you'll have to allow the app to
post on their behalf. This is usually done via an
online (oauth) consent page in a webbrowser.

Commonly, you would call this script every day or week
for every user. Fairpost can then automatically **prepare** the folders,
Expand All @@ -31,7 +32,8 @@ add folders with content.

Or, if you prefer, you can manually publish one
specific folder as posts on all supported and enabled
platforms at once.
platforms at once, or just one post on one platform,
etcetera.


## Setting up
Expand All @@ -48,11 +50,28 @@ cp .env.dist .env && nano .env
# run
./fairpost.js help
```

## Enable platforms

Read how to enable various social media platforms in the [docs](docs).
### Set up platforms

Read how to set up various social media platforms in the [docs](docs).

### Create a user and connect a platform

Read how to connect various social media platforms in the [docs](docs);
but in general, the steps are

```
# create a user foobar
./fairpost.js create-user --userid=foobar

# edit the users .env, finetune settings
# and enable platform `bla`
nano users/foobar/.env

# connect platform `bla` to user `foobar`
./fairpost.js @foobar setup-platform --platform=bla

```

## Feed planning
### Prepare
Expand Down Expand Up @@ -99,9 +118,9 @@ a certain post to a certain platform if you like.

Access and refresh tokens for various platforms may
expire sooner or later. Before you do anything, try
`fairpost.js refresh-platforms`. Eventually, even
`fairpost.js @userid refresh-platforms`. Eventually, even
refresh tokens may expire, and you will have to run
`fairpost.js setup-platform --platform=bla` again
`fairpost.js @userid setup-platform --platform=bla` again
to get a new pair of tokens.


Expand All @@ -110,40 +129,41 @@ to get a new pair of tokens.
```
# basic commands:
fairpost: help
fairpost: get-feed [--config=xxx]
fairpost: setup-platform --platform=xxx
fairpost: setup-platforms [--platforms=xxx,xxx]
fairpost: test-platform --platform=xxx
fairpost: test-platforms [--platforms=xxx,xxx]
fairpost: refresh-platform --platform=xxx
fairpost: refresh-platforms [--platforms=xxx,xxx]
fairpost: get-platform --platform=xxx
fairpost: get-platforms [--platforms=xxx,xxx]
fairpost: get-folder --folder=xxx
fairpost: get-folders [--folders=xxx,xxx]
fairpost: get-post --post=xxx:xxx
fairpost: get-posts [--status=xxx] [--folders=xxx,xxx] [--platforms=xxx,xxx]
fairpost: prepare-post --post=xxx:xxx
fairpost: schedule-post --post=xxx:xxx --date=xxxx-xx-xx
fairpost: schedule-posts [--folders=xxx,xxx|--folder=xxx] [--platforms=xxx,xxx|--platform=xxx] --date=xxxx-xx-xx
fairpost: publish-post --post=xxx:xxx [--dry-run]
fairpost: publish-posts [--folders=xxx,xxx|--folder=xxx] [--platforms=xxx,xxx|--platform=xxx]
fairpost: @userid get-user
fairpost: @userid get-feed
fairpost: @userid setup-platform --platform=xxx
fairpost: @userid setup-platforms [--platforms=xxx,xxx]
fairpost: @userid test-platform --platform=xxx
fairpost: @userid test-platforms [--platforms=xxx,xxx]
fairpost: @userid refresh-platform --platform=xxx
fairpost: @userid refresh-platforms [--platforms=xxx,xxx]
fairpost: @userid get-platform --platform=xxx
fairpost: @userid get-platforms [--platforms=xxx,xxx]
fairpost: @userid get-folder --folder=xxx
fairpost: @userid get-folders [--folders=xxx,xxx]
fairpost: @userid get-post --post=xxx:xxx
fairpost: @userid get-posts [--status=xxx] [--folders=xxx,xxx] [--platforms=xxx,xxx]
fairpost: @userid prepare-post --post=xxx:xxx
fairpost: @userid schedule-post --post=xxx:xxx --date=xxxx-xx-xx
fairpost: @userid schedule-posts [--folders=xxx,xxx|--folder=xxx] [--platforms=xxx,xxx|--platform=xxx] --date=xxxx-xx-xx
fairpost: @userid schedule-next-post [--date=xxxx-xx-xx] [--platforms=xxx,xxx|--platform=xxx]
fairpost: @userid publish-post --post=xxx:xxx [--dry-run]
fairpost: @userid publish-posts [--folders=xxx,xxx|--folder=xxx] [--platforms=xxx,xxx|--platform=xxx]

# feed planning:
fairpost: prepare-posts [--folders=xxx,xxx|--folder=xxx] [--platforms=xxx,xxx|--platform=xxx]
fairpost: schedule-next-post [--date=xxxx-xx-xx] [--folders=xxx,xxx] [--platforms=xxx,xxx]
fairpost: publish-due-posts [--folders=xxx,xxx] [--platforms=xxx,xxx] [--dry-run]
fairpost: @userid prepare-posts [--folders=xxx,xxx|--folder=xxx] [--platforms=xxx,xxx|--platform=xxx]
fairpost: @userid schedule-next-posts [--date=xxxx-xx-xx] [--folders=xxx,xxx] [--platforms=xxx,xxx]
fairpost: @userid publish-due-posts [--folders=xxx,xxx] [--platforms=xxx,xxx] [--dry-run]

# api server
# admin only:
fairpost: create-user --userid=xxx
fairpost: get-user --userid=xxx
fairpost: serve
```

### Common arguments

```
# Select which user to handle
fairpost.js @[user] [command] [arguments]

# Set the cli output format to pure json
fairpost.js [command] [arguments] --output=json

Expand Down
16 changes: 10 additions & 6 deletions docs/Ayrshare.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ But if you have an Ayrshare account, you can enable
it here and enable the platforms that you have connected
to Ayrshare, to publish to those platforms via Ayrshare.

An Ayrshare account can only manage each platform
once per user; you will have to create a new account
for each user.

Ayrshare posts will not be scheduled on Ayrshare;
they will be published instantly. Use Fairpost for
scheduling posts.
Expand All @@ -20,18 +24,18 @@ The Ayrshare platforms supported by FairPost are
- astiktok
- asyoutube

If you only have one user, your user .env is
the same as your global .env

## Setting up the Ayrshare platform
## Connect the platform to a user

### Get an api key for the user

- get an account at Ayrshare
- get your Api key at https://app.ayrshare.com/api
- store this key as FAIRPOST_AYRSHARE_API_KEY in your global .env
- store this key as FAIRPOST_AYRSHARE_API_KEY in your users .env

### Enable and test the facebook platform
### Enable and test a random platform
- Add one or more of the 'as*' platforms to `FAIRPOST_FEED_PLATFORMS` in the users `.env`
- call `./fairpost.js test-platforms`
- call `./fairpost.js @userid test-platforms`

# Limitations

Expand Down
32 changes: 16 additions & 16 deletions docs/Facebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
The `facebook` platform manages a facebook **page** (not your feed)
using the plain graph api - no extensions installed.

If you only have one user, your user .env is
the same as your global .env

## Setting up the Facebook platform
## Set up the platform


### Create a new App in your facebook account
Expand All @@ -18,15 +16,17 @@ the same as your global .env
- save this as `FAIRPOST_FACEBOOK_APP_SECRET` in your global .env
- keep the app under development, otherwise the localhost return url wont work

### Find the page id of the page you want the app to manage
- go to https://business.facebook.com/
- find your page (currently under 'settings > accounts > pages')
- save the page id as `FAIRPOST_FACEBOOK_PAGE_ID` in your users .env
## Connect the platform to a user

### Enable the platform
- Add 'facebook' to your `FAIRPOST_FEED_PLATFORMS` in your users `.env`


### Find the page id of the page you want the app to manage
- go to https://business.facebook.com/
- find your page (currently under 'settings > accounts > pages')
- save the page id as `FAIRPOST_FACEBOOK_PAGE_ID` in your users .env

### Get a (long lived) Page Access Token for the page you want the app to manage

This token should last forever. It involves getting a user access token,
Expand All @@ -48,11 +48,11 @@ tokens, you can turn on Live mode and start posting.
- go to https://developers.facebook.com/
- select your app, edit it
- set App Mode to 'dev'
- call `./fairpost.js setup-platform --platform=facebook`
- call `./fairpost.js @userid setup-platform --platform=facebook`
- follow instructions from the command line

### Test the platform
- call `./fairpost.js test-platform --platform=facebook`
- call `./fairpost.js @userid test-platform --platform=facebook`

### Set the App to Live Mode
before you use the app, set the App Mode to 'Live'
Expand All @@ -61,18 +61,14 @@ before you use the app, set the App Mode to 'Live'
- set App Mode to 'live'
- use https://github.com/commonpike/fairpost/blob/master/public/privacy-policy.md for the privacy policy url

### Other settings

`FAIRPOST_FACEBOOK_PUBLISH_POSTS` - if false, posts will be posted but not be published

## Manage additional pages with the same app
## Connect the platform to another user

One fairpost user can only manage one page. If you create a second user, you can use the same app to manage a different page. The app is registered on your account, so if you can manage the other page, so can the app.

To get this working, you need to follow instruction at [Set up for multiple users](./docs/MultipleUsers.md)

## Add a second user
- call `./fairpost.js add-user --user=foo` # todo
### Add a second user
- call `./fairpost.js create-user --userid=foo`

### Enable the app on the other page

Expand All @@ -92,6 +88,10 @@ To get this working, you need to follow instruction at [Set up for multiple user
### Test the platform for the other page
- call `./fairpost.js @foo test-platform --platform=facebook`

## More user settings

`FAIRPOST_FACEBOOK_PUBLISH_POSTS` - if false, posts will be posted but not be published

# Limitations

## Images
Expand Down
17 changes: 7 additions & 10 deletions docs/Instagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ It uses the related facebook account to
upload temporary files, because the instagram
api requires files in posts to have an url.

If you only have one user, your user .env is
the same as your global .env

## Setting up the Instagram platform
## Set up the platform


### Create a new App in your facebook account
Expand All @@ -30,6 +28,7 @@ the same as your global .env
- under 'settings', find your app secret
- save this as `FAIRPOST_INSTAGRAM_APP_SECRET` in your global .env

## Connect the platform to a user

### Find your instagram user id
- go to https://www.instagram.com/web/search/topsearch/?query={username}
Expand Down Expand Up @@ -60,11 +59,11 @@ tokens, you can turn on Live mode and start posting.
- go to https://developers.facebook.com/
- select your app, edit it
- set App Mode to 'dev'
- call `./fairpost.js setup-platform --platform=instagram`
- call `./fairpost.js @userid setup-platform --platform=instagram`
- follow instructions from the command line

### Test the platform
- call `./fairpost.js test-platform --platform=instagram`
- call `./fairpost.js @userid test-platform --platform=instagram`

### Set the App to Live Mode
before you use the app, set the App Mode to 'Live'
Expand All @@ -73,14 +72,12 @@ before you use the app, set the App Mode to 'Live'
- set App Mode to 'live'
- use https://github.com/commonpike/fairpost/blob/master/public/privacy-policy.md for the privacy policy url

## Manage additional pages with the same app
## Connect the platform to another user

One fairpost user can only manage one page. If you create a second user, you can use the same app id to manage a different page. The app is registered on your account, so if you can manage the other page, so can the app.

To get this working, you need to follow instruction at [Set up for multiple users](./docs/MultipleUsers.md)

## Add a second user
- call `./fairpost.js add-user --user=foo` # todo
### Add a second user
- call `./fairpost.js create-user --userid=foo`

### Find your other instagram user id
- go to https://www.instagram.com/web/search/topsearch/?query={username}
Expand Down
19 changes: 7 additions & 12 deletions docs/LinkedIn.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

The LinkedIn platform posts to your companies feed.

If you only have one user, your user .env is
the same as your global .env

## Setting up the LinkedIn platform

## Set up the platform

### Create a new App in your linkedin account
- create an company your account can manage
Expand All @@ -26,6 +22,7 @@ https://www.linkedin.com/developers/apps/new
in your global `.env`
- add redirect url for your app as set in your .env (http://localhost:8000/callback)

## Connect the platform to a user

### Enable the platform
- Add 'linkedin' to your `FAIRPOST_FEED_PLATFORMS` in your users `.env`
Expand All @@ -35,20 +32,18 @@ https://www.linkedin.com/developers/apps/new
This token last for 60 days and should be refreshed.
The refresh token (if given) lasts for 1 year.

- call `./fairpost.js setup-platform --platform=linkedin`
- call `./fairpost.js @userid setup-platform --platform=linkedin`
- follow instructions from the command line

### Test the platform
- call `./fairpost.js test-platform --platform=linkedin`
- call `./fairpost.js @userid test-platform --platform=linkedin`

## Manage additional pages with the same app
## Connect the platform to another user

One fairpost user can only manage one page. If you create a second user, you can use the same app id to manage a different page. The app is registered on your account, so if you can manage the other page, so can the app.

To get this working, you need to follow instruction at [Set up for multiple users](./docs/MultipleUsers.md)

## Add a second user
- call `./fairpost.js add-user --user=foo` # todo
### Create a new user
- call `./fairpost.js create-user --userid=foo`
- add linkedin to its FAIRPOST_PLATFORMS
- find your company id (in the url, like , 93841222)
- save this as `FAIRPOST_LINKEDIN_COMPANY_ID` in your users .env
Expand Down
Loading