Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

imdb runtimes in hours and minutes

Converts the runtime for films on IMDB from minutes into hours and minutes.

Screenshot

Update Log

6-April-2008: Initial release.
7-April-2008: Updated to use full words (hours/minutes) instead of abbreviations (hr/min). Thanks to Hiromacu for the suggestion.
8-April-2008: Includes tweaked. Thanks again Hiromacu.
8-April-2008: Stupid error corrected. Films longer than 2 hours will now display correctly.






Apr 9, 2008
Hiromacu Scriptwright

Nice! Your modified script is much more better than my! I'm not a programmer, I know just a little bit. :P

 
Apr 8, 2008
Dink Scriptwright

Thanks!!....Another great IMDB script!!!

 
Apr 8, 2008
Hiromacu Scriptwright

And need to add an include: http://us.imdb.com/title/tt*

 
Apr 7, 2008
Hiromacu Scriptwright

Hi znerp!

I changed your script I don't like the abbreviations. So I replaced the 'hrs' and 'mins' abbreviations to the full hour - hours and minute - minutes words.
But this script is great!

Modified full script:

// ==UserScript==
// @name IMDB runtimes in hours and minutes (changed by Hiromacu)
// @namespace znerp
// @description Converts the runtime for films on IMDB from minutes into hours and minutes.
// @include http://www.imdb.com/title/tt*
// ==/UserScript==

/***********************************************************************
* I don't like the abbreviations.
* So I replaced the 'hrs' and 'mins' abbreviations to the full hour - hours and minute - minutes words.
* But this script is great!
*
* - Hiromacu -
*/

infos = document.evaluate("//div[@id='tn15content']/div[@class='info']",
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null)

for (i = infos.snapshotLength - 1; i >= 0; i--) {
if (/Runtime:/.test((time = infos.snapshotItem(i)).innerHTML)) {
time.innerHTML = time.innerHTML.replace(/(\d+) min/g, hourize);
break;
}
}

function hourize(str, p1, offset, s) {
var htxt;
var mtxt;
minutes = parseInt(p1)
hours = Math.floor(p1 / 60);
if (hours > 1) {
htxt = "hours";
}
else {
htxt = "hour";
}
minutes = p1 % 60;
if (minutes > 1) {
mtxt = "minutes";
}
else {
mtxt = "minute";
}
return (hours > 0 ? hours + " " + htxt+ ", " : "") + minutes + " " + mtxt;
}

 
Apr 6, 2008
Neewb Scriptwright

Niccccce !

You could comment on this script if you were logged in.