This repository provides a powerful way to post on your Facebook Page without using any API (based on Playwright).
yarn add @rimiti/facebook-automation
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',
});
The below default browser configuration can be overridden through browserConfiguration constructor attribute.
{
headless: true,
slowMo: 50,
}
- 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.
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.
GPL-3.0 © Dimitri DO BAIRRO