Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Quick and dirty link checker
<script src="" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
$(document).on('submit', function(e){
$.each($('textarea').val().split("\n"), function(index, item){
item = item.trim();
$('body').append('<li>'+item+' OK</li>');
$('body').append('<li>'+item+' Failed</li>');
<script id="tpl-form" type="plain/x-template">
<textarea cols="80" rows="20"></textarea>
$url = filter_var($_GET['q'], FILTER_VALIDATE_URL);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, true); // we want headers
curl_setopt($ch, CURLOPT_NOBODY, true); // we don't need body
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,10);
$output = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpcode >= 400 || empty($output)) {
header("HTTP/1.0 502 Bad Gateway");

This comment has been minimized.

Copy link
Owner Author

@charlycoste charlycoste commented Feb 28, 2018

/linkcheck/proxy.php dans index.html est à modifier en fonction du chemin finalement utilisé pour proxy.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment