定制 migliori/sitemap-crawler 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

migliori/sitemap-crawler

Composer 安装命令:

composer require migliori/sitemap-crawler

包简介

Sitemap crawler/generator. For the given URL it will return sitemap XML file with URLs and images.

README 文档

README

Sitemap crawler/generator. For the given URL it will return sitemap XML file with URLs and images.

Can be used as Standalone or with Ajax (build sitemap, submit to Search Engines & show results on a button click)

Original project: https://github.com/ivebe/sitemap-crawler

Install

composer require migliori/sitemap-crawler

Features

  • crawl given URL and generate sitemap
  • crawl each found URL and add images to the sitemap
  • save the sitemap on your server or download it
  • configure the maximum deph
  • use as standalone (or CRON task)
  • call with ajax on button click
  • onscreen live report with urls count and urls list
  • search engines auto-submission (ping) with onscreen report

Example

<?php

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

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

$config = require __DIR__ . '/vendor/ivebe/sitemap-crawler/src/config.php';

$url = 'http://www.google.com';
/**
 * $dest:
 *      false if you want to download the generated sitemap
 *      'filename.xml' to save file on server
 */
$dest = __DIR__ . '/sitemap.xml';

/**
 * sitemap url for search engines submission
 */
$sitemap_url = 'http://www.google.com/sitemap.xml';

$crawler    = new Crawler($config['crawler']);
$collection = new LinkCollection();
$provider   = new SitemapService($crawler, $collection, $url, $config['sitemap_service']);

$links = $provider->crawl($url);

$provider->export('daily', $dest);

if ($config['submit_to_search_engines'] === true) {
    $provider->SubmitSiteMap($sitemap_url);
}

Example 2 (Ajax)

Refer to ajax-demo.php

统计信息

  • 总下载量: 3.64k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固