Please help me make this userscript from USO work again
And, if it helps you, the following link (from archive.org)
is a snapshot from a page from rottentomatoes.org taken in March, i.e. about the time the script was written
http://web.archive.org/web/20140304102559/http://www.rottentomatoes.com/m/godfather/
Also, I've updated my version of the script in the first post.
It's better now, I think, but still it works for the first part only.
The site appears to add these rating blocks dynamically, so the simplest solution would be to execute after everything loads (you'll briefly see the original 5-based rating):
window.addEventListener('load', function(e) {
if (r = document.querySelector('.audiencepanel h3 span'))
r.setAttribute('data-original-title',
r.getAttribute('data-original-title').replace(/([\d.]+)( stars)/,
function(m, s1, s2) { return 2 * s1 + s2 }));
if (r = document.querySelector('.audience-info dd:nth-child(2)'))
r.innerHTML = r.innerHTML.replace(/[\d.]+/g,
function(m) { return 2 * m });
});
(This code replaces everything after the last header line: // ==/UserScript==)
A better solution I guess would be to use a mutation observer, which is quite simple as well but I'm off to sleep right now.
Thank you very much. It works!!
Just one minor thing, please:
could you make it so that, for the Average Rating,
the "/5" to also change into " /10" ?
For example:
4.3/5 --> 8.6/10
and not 8.6/5
Thanks so much for your help.
Now it's complete.
I made one addition, based on your code:
the popup of the '?' next to the word TOMATOMETER, to display:
instead of
"The percentage of Approved Tomatometer Critics who have given this movie a positive review", this
"The percentage of Approved Tomatometer Critics who have given this movie a positive review (=6 stars or higher)"
update 04/03/15: the selectors used in the 1st and 3rd if
have changed today.
I've uploaded it here
window.addEventListener('load', function(e) {
if (r = document.querySelector('h3.scoreTitle:nth-child(1) > span:nth-child(1)'))
r.setAttribute('title',
r.getAttribute('title').replace(/([\d.]+)( stars)/,
function(m, s1, s2) { return 2 * s1 + s2 }));
if (r = document.querySelector('.audience-info div:nth-child(1)'))
r.innerHTML = r.innerHTML.replace(/[\d.]+/g,
function(m) { return 2 * m });
if (r = document.querySelector('h3.scoreTitle:nth-child(2) > span:nth-child(1)'))
r.setAttribute('title',
r.getAttribute('title')+(' (=6 stars or higher)'));
});
(please delete)
Please help me make this userscript from USO work again
I'm trying to make this script from USO "Rotten Tomatoes Decimal Rating" work again.
His developer, erosman, had done it, based on a request of mine, but I can't contact him now about this.
(I don't think that he's a member here in greasyfork). That script does two things:
I've tweaked it a bit from
into
and unfortunately it works only for the first part.
The problematic part is this, I think:
Please help me with this.