<?php
$url = 'https://www.twitch.tv/lex4tor88/clip/SneakyFantasticMoonLitty?filter=clips&range=all&sort=time';
var_dump(
basename(parse_url($url, PHP_URL_PATH))
);
const fastify = require('fastify');
const SwaggerPlugin = require('fastify-swagger');
const server = fastify({
logger: true
});
server.register(SwaggerPlugin, {
routePrefix: '/doc',
exposeRoute: true,
swagger: {
info: {
title: 'Fastify API',
description: 'Building a blazing fast REST API with Node.js, MongoDB, Fastify and Swagger',
version: '1.0.0'
},
externalDocs: {
url: 'https://swagger.io',
description: 'Find more info here'
},
host: 'localhost:3000',
schemes: ['http'],
consumes: ['application/json'],
produces: ['application/json']
}
});
server.listen(Number.parseInt(process.env.PORT) || 3000, '0.0.0.0', (err, address) => {
if (err) throw err;
server.log.info(`Server listening on ${address}`);
server.swagger()
});
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
await page.goto('https://www.instagram.com/accounts/login/');
await page.waitFor('input[name="username"]');
await page.focus('input[name="username"]');
await page.keyboard.type('login111');
await page.focus('input[name="password"]');
await page.keyboard.type('password');
await page.click('button[type="submit"]');
await new Promise(r => setTimeout(r, 5000));
await browser.close();
})();
connection.query('INSERT INTO users SET ?', {email: 'email@email'})