Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
User Journal

Journal Chacham's Journal: GreaseMonkey scripts 6

I've been making use of GreaseMonkey for some time now. I found some scripts that i lie, namely Allow Password Remembering, Block youtube users, and Google Hit Hider by Domain. I've added a few of my own, Displaying Monk Levels and Checking Saint in our Book for ties, both for PerlMonks and now, Amazon Star percent to number.

I love Amazon Reviews, and those stars mean a lot to me. However, Amazon, in their great wisdom, decided to replace the useful numbers with useless percentages. Well, not useless, but compared to actual numbers, percents mean next to nothing. Who cares if 100% 5-star it, if that's only one person. I'd rather purchase a product with 80% 5-stars, but by a few hundred people. Sure, the number is on top, but who wants to do the math all the time?

To grab the number, the reviews page would have to be loaded for each star. So, i just did multiplication, which will be close enough. I guess the reviews page can get the actual number as opposed to multiplying, but this is good enough, and since it can be the same as the main product page which i did first, i'm not interested in putting in the effort to change it for the reviews page.

This discussion has been archived. No new comments can be posted.

GreaseMonkey scripts

Comments Filter:
  • I write a lot of user scripts and couldn't live without being able to tweak websites to add features, or more often, fix their problems - I just checked Tampermonkey and I've currently got 40 user scripts for various sites :)

    There are a lot faster ways to write them now using features from HTML5 and now ES6 which weren't there even a year ago - for instance, your password script can be rewritten in one line

    Array.from(document.querySelectorAll('input[type=password][autocomplete=off]')).forEach(elem => {

    • by Chacham ( 981 ) *

      Nice.

      I'm a quickie editor when something annoys me enough, so, i don't feel like learning it extensively, though admittedly, it'd be nice.

      I ought to come back to this post before writing a new script though. Maybe some more interest will help me appreciate this information a lot more.

      Thank you!

      • by spiralx ( 97066 )

        My point was just those features make quickie editing even quicker - your Amazon script is

        var el = document.querySelector('#summaryStars, .totalReviewCount'), total = parseInt(el && el.textContent)

        if (total) {
        Array.from(document.querySelectorAll('#histogramTable td:last-child a')), a => {
        var num = parseInt(a.textContent), pct = 100 * (num / total)
        a.innerHTML = `${num} - <b>${pct.toFixed(0)}

        • by Chacham ( 981 ) *

          Ah, ok, i think i got it (as best i can while brushing my teeth. :) ) I appreciate this.

          If i use this in the near future, i ought to let you know (and thank you again.)

        • by Chacham ( 981 ) *

          I'm not comfortable with what you wrote (yet). The easy route for me--right now--is to keep doing it the way that i know. I wonder though, which method works in more browsers (and versions) that support scripting?

          Right now, i want to add a Home button to Memrise [memrise.com] after a course review (maybe even during a review) or learning session. The top bar changes and it takes extra clicks to get home, even when the session is over.

          (Source not shown to do "Filter error: Please use fewer 'junk' characters." And to think

"May your future be limited only by your dreams." -- Christa McAuliffe

Working...