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

Add Site wxscs.com #1620

Merged
merged 1 commit into from
Jan 6, 2025
Merged

Conversation

phazei
Copy link
Contributor

@phazei phazei commented Dec 30, 2024

This addresses this issue:
#1619

It adds support for https://www.wxscs.com with multi-page support.

I used WattpadParser as a reference since it was the only one I could find that supported multi-page.

I'm continually impressed with Claude Sonnet, I gave it about 2 dozen parsers, top/bottom 12 based on size, asked it if anything had multi-page support, had a discussion on how it worked, gave it the html for the index and a random 3 page chapter, and it one shot a completely working extension. I've been a dev for 20 years, and it blows my mind every time I do something like this.

I tested it out on a few books on the site, worked great.

@phazei phazei changed the title Wxscs com support Add Wxscs.com Dec 30, 2024
@phazei phazei changed the title Add Wxscs.com Add Site wxscs.com Dec 30, 2024
@phazei
Copy link
Contributor Author

phazei commented Dec 30, 2024

I noticed before it only worked when I clicked the plugin when on the index page. I fixed it so it works on the chapter page too.

@dteviot
Copy link
Owner

dteviot commented Dec 30, 2024

@phazei
Thank you very much for your hard work.

It's missing an implementation of:

  • getInformationEpubItemChildNodes() => Provides summary/description on information page
  • findCoverImageUrl()

Also, please add your name to readme.md and package.json and squash the commits.

I'm continually impressed with Claude Sonnet, I

Can you provide the script? Or better yet, add a page to the wiki describing what you did? If it can help others, that could save me and the others a lot of work.

@dteviot
Copy link
Owner

dteviot commented Dec 30, 2024

@phazei

used WattpadParser as a reference since it was the only one I could find that supported multi-page.
See:

https://github.com/dteviot/WebToEpub/wiki/FAQ#solutions-to-site-issues-that-require-special-coding

@phazei phazei force-pushed the wxscs_com_support branch from 66e0526 to ef0e9bd Compare January 5, 2025 09:22
@phazei
Copy link
Contributor Author

phazei commented Jan 5, 2025

I updated the requested changes and squashed the commits.

I wanted to note that the getFirstImgSrc helper doesn't work if the selector is the img element itself.

Also, there are some things that aren't available on anything but the index page, like the book cover, and description. If someone clicks the plugin while on a chapter page, it mostly works, but it tries to grab stuff from the wrong pages. For the chapters, it's done async, so I can go and fetch whatever. But everything else is synchronous. I did what I could to check if it's the index page and if not, grab it and cache the DOM of the index page so the items that are on it can be grabbed without grabbing it over and over again. But the onLoadFirstPage isn't called via "await". I think if it were, it would allow the parsers to have more time to set up anything unique that might be on a site. Right now that can only be done when grabbing the chapters, but by then everything else has already been called.

@dteviot dteviot merged commit dfeddf0 into dteviot:ExperimentalTabMode Jan 6, 2025
1 check failed
@dteviot
Copy link
Owner

dteviot commented Jan 6, 2025

@phazei

Thank you for your efforts.

I wanted to note that the getFirstImgSrc helper doesn't work if the selector is the img element itself.

Please raise an issue

Also, there are some things that aren't available on anything but the index page, like the book cover, and description. If someone clicks the plugin while on a chapter page,

I have stopped trying to make WebToEpub work when a ToC is not supplied. (IMHO Not worth the effort to write, test and maintain.) If it worries you, I'd suggest checking WebToEpub has been given a ToC in getChapterUrls(), and if not, give user a warning message.

@dteviot
Copy link
Owner

dteviot commented Jan 6, 2025

@phazei

Additional, there were 2 eslint warnings in the text you supplied. I've pushed a fix.

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

Successfully merging this pull request may close these issues.

2 participants