PHP Classes

File: samples/crawleit.php

Recommend this page to a friend!
  Classes of Juraj Puchký   PHP Sitemap XML Parser   samples/crawleit.php   Download  
File: samples/crawleit.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Sitemap XML Parser
Parse a sitemap to get the URLs of the site pages
Author: By
Last change:
Date: 2 years ago
Size: 293 bytes
 

Contents

Class file image Download
<?php

require_once __DIR__ . '/../vendor/autoload.php';

if(
$argc == 2) {
   
$crawler = new \BABA\Utilities\SitemapCrawler();
   
$crawler->crawleit($argv[1]);
    foreach(
$crawler->getUrls() as $url) {
        echo
"$url\n";
    }
} else {
    echo
"cravleit.php <url of your sitemap>\n";
}