Sha256: 722c1a65b984b1d5b60ecbdfe6f3bdf67670e158edf2c08a13a9e9ca11c4bde9

Contents?: true

Size: 1.27 KB

Versions: 18

Compression:

Stored size: 1.27 KB

Contents

const puppeteer = require('puppeteer')
const fs = require('fs')
const sha1File = require('sha1-file')
require('dotenv').config()

if (!fs.existsSync('./public/assets/screenshots')){
  fs.mkdirSync('./public/assets/screenshots')
}

(async () => {
  const browser = await puppeteer.launch()
  const page = await browser.newPage()
  await page.setViewport({ width: 800, height: 500 })
  await page.goto('https://dashboard.nexmo.com/sign-in')

  await page.waitForSelector('input[name=username]')
  await page.type('input[name=username]', process.env.NEXMO_USERNAME)
  await page.type('input[name=password]', process.env.NEXMO_PASSWORD)
  await page.click('#btn_login')

  await page.waitForSelector('#nav-expander')
  await page.goto('https://dashboard.nexmo.com/settings')

  await page.waitForSelector('#nav-expander')
  await page.click('#httpBaseUrlForMoPost')

  await page.addStyleTag({
    content: `
      #sysId, #password, #signatureSecret {
        filter: blur(5px)
      }
    `
  })

  await page.screenshot({ path: 'public/assets/screenshots/tmp.png' })

  const sha = sha1File('public/assets/screenshots/tmp.png')
  const newPath = `public/assets/screenshots/${sha}.png`
  fs.renameSync('public/assets/screenshots/tmp.png', newPath)

  await browser.close()

  console.log(newPath)
})()

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
station-0.0.113 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.112 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.111 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.110 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.109 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.108 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.107 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.106 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.105 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.104 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.103 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.102 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.101 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.100 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.97 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.96 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.95 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js
station-0.0.93 lib/nexmo_developer/app/screenshots/webhook-url-for-inbound-message.js