rifat-h / site-map-scanner
一个用于扫描 URL 并返回 Sitemap XML 字符串的包
dev-main
2024-06-24 06:40 UTC
Requires
- ext-dom: *
This package is auto-updated.
Last update: 2024-09-24 07:12:02 UTC
README
laravel sitemap scanner,接收 URL 并返回作为字符串的 sitemap xml
安装
在您的 laravel 项目中,运行 composer require rifat-h/site-map-scanner
使用
要运行扫描器,首先在您的 PHP 文件顶部添加 use RifatH\SiteMapScanner\Scanner\Scanner;
然后可以这样使用。
use RifatH\SiteMapScanner\Scanner\Scanner;
public function index()
{
$Scanner = new Scanner("https://www.mentiongenie.com/", 6); // param1: url of the site, param2: max_depth
$SiteMapXml = $Scanner->scan();
dd($SiteMapXml); // This will return the XML of the sitemap as string, just do your thing with it.
}