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

Help adding Site omgbeaupeep.com #44

Open
LoLsAlEd opened this issue Aug 19, 2015 · 3 comments
Open

Help adding Site omgbeaupeep.com #44

LoLsAlEd opened this issue Aug 19, 2015 · 3 comments

Comments

@LoLsAlEd
Copy link

I was able to get the script to load one chapter using this code but unfourtunutly I am not skilled in Javascript, so I have no clue how to fix it and get the rest of the script working.

// @include        http://www.omgbeaupeep.com/*
{   url:    'omgbeaupeep.com',
    img:    [['#omv .picture']],
},

If someone could help me fix it that would be great.

@anka-213
Copy link

anka-213 commented Nov 9, 2015

It seems to work just fine with just that. It's easy enough to switch chapter manually, so it doesn't seem to be worth the effort of automating that. You can add extra: [[['.pager']]], as well, so show the pager is visible to simplify the chapter switching.

Is there any specific other feature you are missing?

@LoLsAlEd
Copy link
Author

LoLsAlEd commented Nov 9, 2015

Nah not really, I'm pretty happy with how its working.

Thanks anyway.

@anka-213
Copy link

anka-213 commented Nov 9, 2015

I decided to make a chapter switcher anyways: ;)

    back: function(html, pos) {
        try {
            return xpath('//a[img[@alt="Previous Page"]]/@href', html);
        } catch (e) {
            var newChapter = xpath('//select[@name="chapter"]/*[@selected]/preceding-sibling::*[1]/@value', html);
            var currChapter = xpath('//select[@name="chapter"]/*[@selected]/@value', html);
            return link[pos].replace(currChapter, newChapter);
        }
    },
    next: function(html, pos) {
        try {
            return xpath('//a[img[@alt="Next Page"]]/@href', html);
        } catch (e) {
            var newChapter = xpath('//select[@name="chapter"]/*[@selected]/following-sibling::*[1]/@value', html);
            var currChapter = xpath('//select[@name="chapter"]/*[@selected]/@value', html);
            return link[pos].replace(currChapter, newChapter).replace(/\/[^\/]*$/, "/1");
        }
    },

The backwards version jumps to the start of the chapter, instead of the end, because I couldn't find a way to determine how many pages a chapter has.

anka-213 referenced this issue in anka-213/webcomic_reader Nov 9, 2015
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