2017 © Pedro Peláez
 

library sitemap

Simple Google Sitemap Generator

image

denismitr/sitemap

Simple Google Sitemap Generator

  • Thursday, January 12, 2017
  • by denismitr
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PHP Sitemap generator for websites

Author - Denis Mitrofanov

TheCollection.ru, (*1)

Version 1.0.0

Usage

This program crwawls the entire website storing links, priorities and update periods., (*2)

$sitemap = new Sitemap('http://moskvado.ru/');
$sitemap
    ->setExcluded(['http://moskvado.ru/dashboard/', 'http://moskvado.ru/register/', 'http://moskvado.ru/login/'])
    ->setLevel(0, 1, 'daily')
    ->setLevel(1, 0.80, 'weekly')
    ->setLevel(2, 0.64, 'weekly')
    ->setLevel(3, 0.64, 'monthly')
    ->setDefaultUpdatePeriod('monthly')
    ->setMinimalProirity(0.5);


    $links = $sitemap->generate();
    $links->toXmlFile('sitemap.xml');

First you set the website you want to parse, than set the routes you want to exclude. Levels are set from 0 as domain root, to the third level, everything else should be set as minimalPriority (default is 0.64). Default update period is set to 'monthly'., (*3)

When you run $sitemap->generate() it return a LinksCollection object. Than you can persist it to actual sitemap.xml file. By runnig $links->toXmlFile('sitemap.xml') of course you can specify full path, and not just the file name., (*4)

The output will contain xml with line for every detected link like following:, (*5)

<url>
    <loc>http://moskvado.ru/kompyutery-i-it-uslugi/orgtekhnika/</loc>
    <changefreq>weekly</changefreq>
    <priority>0.64</priority>
</url>

Resources that use this generator are:

The Versions

12/01 2017

dev-master

9999999-dev

Simple Google Sitemap Generator

  Sources   Download

MIT

12/01 2017

1.0.1

1.0.1.0

Simple Google Sitemap Generator

  Sources   Download

MIT

12/01 2017

1.0.0

1.0.0.0

Simple Google Sitemap Generator

  Sources   Download

MIT