ivebe/sitemap-crawler

Sitemap crawler/generator. For given URL it will return sitemap XML file.

0.0.2 2017-03-03 16:35 UTC

This package is not auto-updated.

Last update: 2024-12-25 21:37:56 UTC


README

Sitemap crawler/generator. For given URL it will return sitemap XML file.

Install

composer require ivebe/sitemap-crawler

Example

<?php

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

use Ivebe\SitemapCrawler\Crawler;
use Ivebe\SitemapCrawler\SitemapService;
use Ivebe\SitemapCrawler\LinkCollection;

$config = require "src/config.php";
$url = "http://www.google.com";

$crawler    = new Crawler($config);
$collection = new LinkCollection();
$provider   = new SitemapService($crawler, $collection);

$links = $provider->crawl($url);
$provider->export('monthly');