Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return name of sitemap that url was returned from? #16

Open
AlJohri opened this issue Nov 4, 2018 · 1 comment
Open

return name of sitemap that url was returned from? #16

AlJohri opened this issue Nov 4, 2018 · 1 comment

Comments

@AlJohri
Copy link

AlJohri commented Nov 4, 2018

I'm working with a recursive sitemap and it would be helpful to return the name of the sitemap url that the item was returned from. is this possible?

I would ideally like this returned {sitemap: "...", url: "..."}

or perhaps even better, a way to prevent it from even going down certain paths of the sitemap tree based on a regex. my sitemap is datebased and I don't want it to traverse farther back than a few days

@evanderkoogh
Copy link
Owner

Hey @AlJohri, apologies it has taken a while, been super busy with my startup the last few weeks.

But I am pretty sure I have implemented both your suggestions..

The URL callback now also supplies a second argument, the url of the sitemap we are currently parsing.
And the parseSitemaps method takes a 4th argument, a function that takes the url of the found sitemap. It will be added to the list to parse if the function returns true.

They are published to npm under version 1.5.1
Let me know if they work!

As I am really busy, could I ask you to add an example to the README with these 2 features?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants