@rimiti/facebook-automation
v1.6.0
Published
Post on facebook
Downloads
10
Readme
facebook-automation
Description
This repository provides a powerful way to post on your Facebook Page without using any API (based on Playwright).
Install
yarn add @rimiti/facebook-automation
Example
import { FacebookAutomation } from '@rimiti/facebook-automation';
const facebookAutomation: FacebookAutomation = new FacebookAutomation({
credentials: {
login: '[email protected]',
password: '$secr€t',
},
pageUrl: 'https://www.facebook.com/my-page-id',
browserConfiguration: { // Optional
headless: false,
args: ['--no-sandbox']
}
});
await facebookAutomation.post({
text: 'Hello world',
imagePath: './example.jpg',
});
Default browser configuration
The below default browser configuration can be overridden through browserConfiguration constructor attribute.
{
headless: true,
slowMo: 50,
}
Limitation
- To avoid scrappers (not only), Facebook isn't using "id" elements. It's why some of elements are selected from "text content". Your Facebook account must be in English.
Scripts
Run using yarn run <script>
command.
clean - Remove temporarily folders.
build - Compile source files.
build:watch - Interactive watch mode, compile sources on change.
lint - Lint source files.
lint:fix - Fix lint source files.
test - Runs all tests with coverage.
test:watch - Interactive watch mode, runs tests on change.
License
GPL-3.0 © Dimitri DO BAIRRO