@faya/drowsy
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Drowsy

WordPress automation made with puppeteer and typescript

Install

yarn add puppeteer typescript @faya/drowsy

Usage

see example

Setup config

WordPress version is needed for selectors.

import drowsy from '@faya/drowsy';

const config: drowsy.Config = {
    wp: {
        ver: '5.0.3',
        url: 'https://your.wordpress.com',
        user: '__username__',
        password: '__password__'
    },
    LaunchOptions: {
        headless: false
    }
};

make new post content

const newpost: drowsy.Post = {
    title: 'drowsy',
    type: 'blog',
    content: 'post this by drowsy!'
};

Run it

(async () => {
    const wp = await drowsy.launch(config);
    await wp.login();
    await wp.post(newpost);
    await wp.close();
})();

Readme

Keywords

none

Package Sidebar

Install

npm i @faya/drowsy

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

38.5 kB

Total Files

21

Last publish

Collaborators

  • nerd_yue