Tag: 网站地图

使用NodeJS查找域中的所有页面

我试图find一个域上的所有页面与节点。 我正在寻找Stackoverflow,但是我发现这是Ruby的这个线程: find一个域及其子域中的所有网页 – 我有同样的问题,但对于节点。 我也search了这个问题,但是我发现所有的东西都是找不到链接的刮板。 我也在寻找像“网站地图生成器”,“网页机器人”,“自动刮板”,“获取所有页面的域名与节点”,但没有带来任何结果。 我有一个需要处理的链接arrays的刮板,例如我有一个www.example.com/products/页面,在这里我想find所有现有的子页面,例如www.example.com/products/product1 .html,www.example.com/products/product2.html等。 你能给我一个提示,我怎么能在Node中实现它?

站点地图不会创build,直到服务器重新启动meteor

我正在使用meteor来创build简单的博客系统。 对于站点地图文件,我正在使用这个包。 我在服务器启动函数中添加了一些初始化数据(创build一些post),并在服务器中使用下面的代码( server / sitemaps.js )为每个类别创build站点地图(例如,第一类的sitemap1.xml等): function sitemapOutput(categoryName){ var out = [], posts = Posts.find({ category: categoryName }).fetch(); _.each(posts, function(post) { out.push({ page: post.url(), lastmod: post.insertDate, changefreq: 'weekly' }); }); return out; } Categories.find().forEach(function(Category, index) { sitemaps.add('/sitemap' + (index+1) +'.xml', function(){ return sitemapOutput(Category.name); }); }); 我有这样的启动:( server / startup.js ) Meteor.startup(function () { // […]