Carlos Roa Troncoso

All generations.

generate functionMon, 27 Mar 2023

Una web que lea una API de cómics

const url = 'https://cors-anywhere.herokuapp.com/https://comicvine.gamespot.com/api/' const key = 'c8869ee6b0c6f7d6f81b6dcff7a8f9fc9b7d3d3a' const limit = 100 function getVolumes() { fetch(`${url}volumes/?api_key=${key}&field_list=id,name,count_of_issues,publisher&format=json&limit=${limit}`) .then(function(response) { return response.json(); }) .then(function(data) { showVolumes(data.results); }); function showVolumes(volumes) { let html = '' volumes.forEach(function(volume){ html += ` <div class="col-6 col-md-4 col-lg-2"> <div class="card"> <img src="img/volumes/${volume

Javascript
View
generate functionMon, 27 Mar 2023

Una web que lea una API de cómics

function getComics() { fetch("https://gateway.marvel.com:443/v1/public/comics?ts=1&apikey=8c5a6a0d659b91aeb313f8c401ce7858&hash=fefd7b9676f8c7a6b3a3da3d13e2d8f7") .then(response => response.json()) .then(data => { const comics = data.data.results; comics.forEach(comic => { document.body.innerHTML += `<li>${comic.title}</li>`; }); }); } getComics();

Javascript
View

Genera una página donde se puedan leer comics para luego usar una API con Javascript

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <table border="1"> <tr> <th>Titulo</th> <th>Autor</th> <th>Url</th> </tr> <tr> <td>Batman: The Man Who Laughs</td> <td>Ed Brubaker</td> <td>https://www.comics.org/issue/21533/</td> </tr> </table> </body> </html>

Questions about programming?Chat with your personal AI assistant