0.1.3 • Published 9 years ago

submit-sitemap v0.1.3

Weekly downloads
475
License
MIT
Repository
github
Last release
9 years ago

submit-sitemap module for Node.js

Module to submit/ping a sitemap XML file to Google and Bing. This automates the manual process of submitting your sitemap via Google's webmaster tools and Bing's webmaster tools.

Use this after your site content has changed to encourage search engines to recrawl your site for Search Engine Optimisation (SEO) purposes. For example, this is useful to do after deploying a site update in Grunt and Gulp scripts.

If you're looking for modules to generate sitemaps, you may want to consider grunt-sitemap for Grunt and gulp-sitemap for Gulp.

Usage

To install:

npm install submit-sitemap --save-dev

To submit your sitemap:

var submitSitemap  = require('submit-sitemap').submitSitemap;
var yourSitemapUrl = "http://www.google.com/sitemap.xml";

submitSitemap(yourSitemapUrl);

Use the callback parameter to respond to success and failure:

submitSitemap(yourSitemapUrl,  function(err) { console.error(err); });
  • On success, err will be undefined.

  • On error, err will be set to an error message. This happens if the sitemap URL could not be reached or any of the sitemap submission attempts failed.

Tests

To run the test suite:

npm test

License

MIT

Author

Written by Sean Wilson (sw@seanw.org).