Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crear comprobador de enlaces rotos #1

Open
hhkaos opened this issue Jan 5, 2021 · 1 comment
Open

Crear comprobador de enlaces rotos #1

hhkaos opened this issue Jan 5, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@hhkaos
Copy link
Contributor

hhkaos commented Jan 5, 2021

Se podría crear un script sencillo que cargase todos los enlaces de una pestaña e intentase recuperar todos los recursos y comprobando cuáles de ellos devuelven 404.

usando fetch

fetch('/somepage')
  .then(function(response) {
    return response.text();
  })
  .then(function(body) {
    document.querySelector('#div').innerHTML = body;
  });

O usando XMLHttpRequest

var request = new XMLHttpRequest();

request.open('GET', '/somepage', true);

request.onload = function() {
  if (request.status >= 200 && request.status < 400) {
    var resp = request.responseText;

    document.querySelector('#div').innerHTML = resp;
  }
};

request.send();
@hhkaos hhkaos added the enhancement New feature or request label Jan 7, 2021
@hhkaos hhkaos changed the title Tareas pendientes para la v1.0 Crear comprobador de enlaces rotos Jan 8, 2021
@libertadcc
Copy link

También lo podemos hacer dentro de google sheets. En el actual no me deja acceder al editor de secuencias de comandos.
https://docs.google.com/spreadsheets/d/1J8YWMjMGX0PxJeUn7flzqQoJfX5m5rmi57zNFufH6eg/edit?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants