webartisan/urlscanner

This package is abandoned and no longer maintained. No replacement package was suggested.

Scan URLs from a CSV file and report inaccessible URLs

v1.0 2017-10-29 17:09 UTC

This package is not auto-updated.

Last update: 2020-01-24 17:12:25 UTC


README

Scans URLs and return unresponsive link - This is an updated urlscanner base from the depreciated book of Modern PHP

Install

Via Composer

composer require webartiasn/urlscanner

Usage

use Webartisan\Url\Scanner;

$url = [
    "https://davidkhierl.com",
    "http://php.net",
    "http://asdwasd.com"
];

$scanner = new Scanner($url);

print_r($scanner->getInvalidUrls());

Scanning CSV

use Webartisan\Url\Scanner;
use League\Csv\Reader;

$urls = [];

$csv = Reader::createFromPath($argv[1]);

foreach ($csv as $url) {
    array_push($urls, $url[0]);
}

$scanner = new Scanner($urls);

$result = $scanner->getInvalidUrls();

if (!empty($result)) {
    print_r($scanner->getInvalidUrls());
}
else {
    print("All url is working" . PHP_EOL);
}

Testing

No testing yet.

Contributing

See CONTRIBUTING.md

Credits

License

The MIT License (MIT). Please see License File for more information.