PHP code example of webignition / website-sitemap-finder

1. Go to this page and download the library: Download webignition/website-sitemap-finder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webignition / website-sitemap-finder example snippets



use webignition\WebsiteSitemapFinder\Configuration;
use webignition\WebsiteSitemapFinder\WebsiteSitemapFinder;

$configuration = new Configuration([
    Configuration::KEY_ROOT_URL => 'http://google.com/',
]);

$finder = new WebsiteSitemapFinder($configuration);        
$sitemapUrls = $finder->findSitemapUrls();

$this->assertEquals($sitemapUrls, [
    'http://www.gstatic.com/culturalinstitute/sitemaps/www_google_com_culturalinstitute/sitemap-index.xml',
    'http://www.gstatic.com/s2/sitemaps/profiles-sitemap.xml',
    'https://www.google.com/sitemap.xml',
]);