diff --git a/README.md b/README.md index 5b7bdf6..42074e3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # Web to Kindle -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/kreativitat/web-to-kindle-heroku) + diff --git a/app.json b/app.json index e913f0e..9fbb3ca 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "name": "Web to Kindle", "description": "A service to create Kindle-ready web page screenshots", - "repository": "https://github.com/lankybutmacho/web-to-kindle-heroku", + "repository": "https://github.com/kreativitat/web-to-kindle-heroku", "buildpacks": [ { "url": "heroku/nodejs" diff --git a/index.js b/index.js index be66239..3225098 100644 --- a/index.js +++ b/index.js @@ -13,8 +13,12 @@ express() .get('/', async (req, res) => { const browser = await puppeteer.launch({ args: ['--no-sandbox', '--disable-setuid-sandbox'] }); const page = await browser.newPage(); - await page.setViewport({ width: 600, height: 800 }); + await page.setViewport({ width: 1072, height: 1448 }); await page.goto(process.env.SCREENSHOT_URL || 'https://darksky.net/details/40.7127,-74.0059/2021-1-6/us12/en'); + // wait 5 sec + await page.waitFor(5000); + //await page.waitForNavigation({ waitUntil: 'networkidle0' }); + await page.screenshot({ path: '/tmp/screenshot.png', }); @@ -35,7 +39,7 @@ express() function convert(filename) { return new Promise((resolve, reject) => { - const args = [filename, '-gravity', 'center', '-extent', '600x800', '-colorspace', 'gray', '-depth', '8', filename]; + const args = [filename, '-gravity', 'center', '-extent', '1072x1448', '-colorspace', 'gray', '-depth', '8', filename]; execFile('convert', args, (error, stdout, stderr) => { if (error) { console.error({ error, stdout, stderr }); diff --git a/package.json b/package.json index 79cc97d..3ef85bf 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/lankybutmacho/web-to-kindle-heroku" + "url": "https://github.com/kreativitat/web-to-kindle-heroku" }, "license": "MIT" }