Simple template of puppeteer in Cloud Function
I hope it helps you.
Packages:
- Puppeteer 8.0.0
- Node version 12
const puppeteer = require('puppeteer'); | |
const urlLogin = 'https://myweb.com'; | |
exports.getzip = async (req, res) => { | |
const { user, pass, year, month } = req.body; | |
console.log('Starting puppeteer...'); | |
const browser = await puppeteer.launch({ headless: true, slowMo: 100}); | |
try { | |
const page = await browser.newPage(); | |
console.log('go to url login...'); |
def anagram(word, word2) | |
word.delete(" " "," ".").downcase.chars.sort.join === word2.delete(" " "," ".").downcase.chars.sort.join | |
end | |
words = [ | |
["casa", "saca"], | |
["frase", "fresa"], | |
["letras", "lastre"], | |
["cosa", "sica"], |
const miArray = [1, 2, 3, 4, 5]; | |
const sum = (arrayInt) => { | |
return arrayInt.reduce((accum , current) => (accum + current), 0); | |
} | |
const suma = (arr2) => (func) => (func(sum(arr2))); | |
// Ejemplo de uso | |
suma(miArray) ( |
server { | |
... | |
location / { | |
proxy_pass http://localhost:3000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} |
Se agrego el paquete de Wget en la construcción de la APP para que esta pueda enviar el token a Laravel Forge y hacer un despliegue siempre y cuando los testing pasen en la aplicación que es la forma correcta de desplegar una aplicación.
$receiver_id = obtener-al-crear-una-cuenta-de-cobro; | |
$secret = 'obtener-al-crear-una-cuenta-de-cobro'; | |
$api_version = 'obtener-desde-los-parametros'; // Parámetro api_version | |
$notification_token = 'obtener-desde-los-parametros'; //Parámetro notification_token | |
$amount = monto-original-del-cobro; | |
try { | |
if ($api_version == '1.3') { | |
$configuration = new Khipu\Configuration(); |
let bancos = [ | |
{ "nombre": "Agropecuario - AgroBanco" }, | |
{ "nombre": "Azteca del Perú S.A."}, | |
{ "nombre": "Banco de Crédito del Perú"}, | |
{ "nombre": "BBVA Banco Continental"}, | |
{ "nombre": "Cencosud"}, | |
{ "nombre": "Central de Reserva del Perú"}, | |
{ "nombre": "Citibank del Perú"}, | |
{ "nombre": "Banco de Comercio"}, | |
{ "nombre": "Banco de la Nación"}, |