TESTE
- Criar CRUD (listar, adicionar, editar, remover) de dados fictícios.
TECNOLOGIA
<?php | |
$url = 'https://www.gov.br/nfse/pt-br/municipios/municipios-aderentes/municipios-aderentes'; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
<?php | |
/** | |
* User: LuizVAz | |
* Date: 28/02/2021 | |
* Time: 19:46 | |
*/ | |
namespace Provedores\webService; | |
use DOMDocument; |
#!/bin/bash | |
for i in {1..5} | |
do | |
URL="https://dummyjson.com/products/$i" | |
response=$(curl -s $URL) | |
echo $response | |
printf "\n" |
O desafio é criar um endpoint para extrair os produtos do site: https://webscraper.io/test-sites/e-commerce/static e retornar um json.
Tecnologia Utilize a tecnologia que se sentir mais confortavel.
{ | |
"emmet.syntaxProfiles" : { | |
"javascript" : "jsx" | |
}, | |
"workbench.startupEditor" : "newUntitledFile", | |
"editor.fontSize" : 16, | |
"javascript.suggest.autoImports" : true, | |
"javascript.updateImportsOnFileMove.enabled" : "always", | |
"editor.rulers" : [ | |
80, |
'use strict'; | |
const crypto = require('crypto'); | |
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters) | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
function encrypt(text) { | |
let iv = crypto.randomBytes(IV_LENGTH); | |
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv); |
<?php | |
//Converte em array linha de e-mails com 2 tipos de separadores , e ; | |
$email="fernanda@ajudes.org.br;josi@ajudes.org.br;"; | |
$emails = preg_split('/[\s,; ]+/', $email, -1, PREG_SPLIT_NO_EMPTY); | |
print_r($emails); |
<?php | |
function detect_encoding($string) | |
{ | |
//http://w3.org/International/questions/qa-forms-utf-8.html | |
if (preg_match('%^(?: [\x09\x0A\x0D\x20-\x7E] | [\xC2-\xDF][\x80-\xBF] | \xE0[\xA0-\xBF][\x80-\xBF] | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} | \xED[\x80-\x9F][\x80-\xBF] | \xF0[\x90-\xBF][\x80-\xBF]{2} | [\xF1-\xF3][\x80-\xBF]{3} | \xF4[\x80-\x8F][\x80-\xBF]{2} )*$%xs', $string)) | |
return 'UTF-8'; | |
//If you need to distinguish between UTF-8 and ISO-8859-1 encoding, list UTF-8 first in your encoding_list. | |
//if you list ISO-8859-1 first, mb_detect_encoding() will always return ISO-8859-1. |