PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Arturs Sosins   Curl multi sitemap   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example usage of class methods
Class: Curl multi sitemap
Generate multiple sitemaps crawling sites
Author: By
Last change: credits changed
Date: 11 years ago
Size: 2,056 bytes


Class file image Download
 * This script is developed by Arturs Sosins aka ar2rsawseen,
 * Fee free to distribute and modify code, but keep reference to its creator
 * This class can generating sitemap by parsing given URL and recursively follow same domain links
 * using multiple curl requests, which makes parsing much more faster than file_get_contents or default curl requests.
 * You can create sitemaps for multiple domains or subdomains and specify which URLs to ignore.
 * Then you can retrieve array of gathered links and generate valid xml based sitemap.
 * You can also notify such services as Google, Yahoo, Bing, Ask and Moreover about your sitemap update.
 * For more information, examples and online documentation visit:

//setting to no time limit,

//declaring class instance
$sitemap = new sitemap();

//optionally set proxy server name and port or ip and port
//comment-out or set to an empty string to disable proxy use

//setting rules to ignore URLs which contains these substrings
$sitemap->set_ignore(array("javascript:", ".css", ".js", ".ico", ".jpg", ".png", ".jpeg", ".swf", ".gif"));

//parsing one page and gathering links

//parsing other page and gathering links

//return URL list as array
//$arr = $sitemap->get_array();

//echo "<pre>";
//echo "</pre>";

header ("content-type: text/xml");
//generating sitemap
$map = $sitemap->generate_sitemap();

//submitting site map to Google, Yahoo, Bing, Ask and Moreover services