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

What about adding saveXML or a __toString to both Sitemap and Index? #69

Open
doppiogancio opened this issue Dec 1, 2020 · 4 comments

Comments

@doppiogancio
Copy link

Hi, I found really helpful this package, but since I need to use a different writer I was wondering if its possible to add a method to export the XML as a string for both the classes Sitemap and Index.

@samdark
Copy link
Owner

samdark commented Dec 2, 2020

@doppiogancio yes, that's possible but that could be resource consuming. When writing to file, it's writing each piece separately so memory usage stays low.

@terales
Copy link
Contributor

terales commented Dec 2, 2020

@doppiogancio you can write to a temporary file location and then stream the contents into your desired location. Are you pushing sitemap to S3-like storage?

@doppiogancio
Copy link
Author

First of all thanks to both @samdark @terales for the answers.

@doppiogancio you can write to a temporary file location and then stream the contents into your desired location. Are you pushing sitemap to S3-like storage?

Yes, I am using FlySystem. I solved the problem creating the files in a temporary folder, and only after uploading them to S3.

@samdark I understand, you are right. Having the chance to provide a new writer from the outside do you think is doable? Any concern?

@samdark
Copy link
Owner

samdark commented Jan 13, 2021

Current version is quite coupled in this matter. I've started big refactoring a few years ago in #59 but then got occupied by other things. That new version should be better about replacing writers.

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

3 participants