Coder Social home page Coder Social logo

php-sitemap-generator's Introduction

Tristan Goossens

     

php-sitemap-generator's People

Contributors

oblab avatar tristangoossens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

php-sitemap-generator's Issues

Inappropriate link protocols included in sitemap

I would argue that links containing the "mailto" and "tel" protocols should not be included in the sitemap. I had an email link show in my sitemap because it included the website domain in the address (whereas the GMail address was not included, because external links were not being crawled). A reference explaining this type of link: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a

For example, a crawl of the "www.examplesite.com" website which contains a "mailto" link using the "[email protected]" address, would have an entry like this in the sitemap:
http://www.examplesite.com/mailto:[email protected]

Retrieve the modified date and populate de sitemap

I try to retrieve the <meta property="article:modified_time" content="" /> in my website to populate <lastmod> tag in the sitemap

In sitemap-generator.php, after :

libxml_use_internal_errors(true);
		$dom = new DOMDocument();
		@$dom->loadHTML($html);

I add this :

		$xp = new domxpath($dom);
			foreach ($xp->query("//meta[@property='article:modified_time']") as $el) {
				 $el->getAttribute("content");
			}

I'm a beginner in php, how can i add $el to the xml ?
Also, i'd like to format the modified_time in Y-M-D
thanks

Xml error with ampersands

I had this error when i tried to generate the sitemap : $dom->loadXML($xml); EntityRef: expecting ';' at line 163
so i add this code, and now it's working well
$xml = str_replace('&', '&amp;', $xml);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.