Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sitemapper

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sitemapper - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

LICENSE

21

lib/sitemap.js

@@ -33,3 +33,3 @@ /*

});
}
};

@@ -39,2 +39,4 @@ sitemap.getSites = function(url, callback){

var d,s,error,sites = [];
var sUrlSize = 1;
var parseCnt = 0;
this.parse(url, function read(err, data){

@@ -47,11 +49,16 @@ if(!err)

sites = _.flatten(sites);
callback(error,sites);
parseCnt++;
if (parseCnt === sUrlSize) {
callback(error, sites);
}
}
else if(s = data.sitemapindex)
{
_.each(_.flatten(_.pluck(s.sitemap, "loc")), function(url){
var sitemapUrls = _.flatten(_.pluck(s.sitemap, "loc"));
sUrlSize = _.size(sitemapUrls);
//console.log(sitemapUrls);
_.each(sitemapUrls, function(url){
self.parse(url, read);
})
}
else{
});
}else{
error = "no valid xml";

@@ -64,2 +71,2 @@ }

});
}
};
{
"name": "sitemapper",
"version": "0.0.1",
"version": "0.0.2",
"description": "Parser for XML Sitemaps to be used with Robots.txt and web crawlers",

@@ -15,2 +15,3 @@ "keywords": [

"homepage": "http://github.com/hawaiianchimp/sitemap-parser",
"tonicExampleFilename": "example.js",
"bugs": {

@@ -17,0 +18,0 @@ "url": "http://github.com/hawaiianchimp/sitemap-parser/issues"

@@ -6,9 +6,13 @@ ##Sitemap-parser

####Simple Implementation
```javascript
var sitemap = require('sitemapper');
var sitemap = require("sitemap-parser");
sitemap.getSites("http://www.cbs.com/sitemaps/show/show_siteMap_index.xml", function(err, sites){
if(!err)console.log(sites);
else console.log(error);
});
sitemap.getSites('http://www.cbs.com/sitemaps/show/show_siteMap_index.xml', function(err, sites) {
if(!err) {
console.log(sites);
}
else {
console.log(err);
}
});
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc