Browse Source

changed config file

master
Andres Becker 3 years ago
parent
commit
1098f32b0f
  1. 11
      README.md
  2. 1
      sample.config.js
  3. 3
      update-hours.js

11
README.md

@ -13,7 +13,7 @@ Requires: @@ -13,7 +13,7 @@ Requires:
$ npm init
$ npm i --save puppeteer # or yarn add puppeteer
$ mv sample.config.js config.js
$ vim config.js # Edit your user name and password
$ vim config.js # Edit your user name and password and chrome path.
```
## update-hours.js
@ -22,14 +22,7 @@ Requires: @@ -22,14 +22,7 @@ Requires:
**Config options:**
To use a preinstalled browser change `executablePath` in update-hours.js to contain the full path to the executable chrome or chromium binary.
```javascript
const browser = await puppeteer.launch({
headless: true,
executablePath: './node_modules/puppeteer/.local-chromium/linux-99999/chrome-linux/chrome',
});
```
To use a preinstalled browser change `executablePath` in sample.config.js to contain the full path to the executable chrome or chromium binary.
Checkout [puppeteer](https://github.com/GoogleChrome/puppeteer) for more config options.

1
sample.config.js

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
module.exports = {
usr: 'email@yourmail',
psw: 'secret',
chrome_path: './node_modules/puppeteer/.local-chromium/linux-99999/chrome-linux/chrome',
hours: '8'
}

3
update-hours.js

@ -29,8 +29,7 @@ const config = require('./config'); @@ -29,8 +29,7 @@ const config = require('./config');
(async () => {
const browser = await puppeteer.launch({
headless: true,
executablePath: '/usr/bin/google-chrome',
//executablePath: './node_modules/puppeteer/.local-chromium/linux-672088/chrome-linux/chrome',
executablePath: config.chrome_path,
args: ['--no-sandbox', '--window-size=1280,800'],
defaultViewport: { width: 1280, height: 800 }
});

Loading…
Cancel
Save