Greasy Fork is available in English.

IMDBAge

Adds the age and other various info onto IMDB pages.


Installer ce script?
/*  IMDBAge v2.14 - Greasemonkey script to add actors ages to IMDB pagesCopyright (C) 2005-2020 Thomas Stewart <[email protected]>This program is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program.  If not, see <http://www.gnu.org/licenses/>.Inspired in 2001, Created on 24/03/2005, Last Changed 28/12/2020Major bug fixes and improvements by Christopher J. MadsenThis is a Greasemonkey user script, see http://www.greasespot.net/ andhttps://addons.mozilla.org/firefox/addon/748New versions can be found on the following sites:https://stewarts.org.uk/project/imdbage/http://userscripts.org/scripts/show/1060 (dead)https://gfork.dahi.icu/scripts/2798-imdbagehttps://monkeyguts.com/code.php?id=268 (dead)https://openuserjs.org/scripts/thomas_d_stewart/IMDBAgehttps://github.com/thomasdstewart/IMDBAgeThis script adds the age and other various info onto IMDB pages.Specifically it adds some details to actor or actresses pages. It addstheir age, their Tropical Zodiac Sign and their Chinese Zodiac Sign. Aswell as adding how many years ago and how old they were when they made thelisted films. It also adds how long a go a film was made on a film page.This script is not abandoned, email [email protected] if it breaks.Changelog* 2.14 fixed icon, improved getNameDates, new style fixes, reformating* 2.13 added https urls, removed scriptvals, fixed title pages* 2.12 fixed adding ages to individual films and fixed old style* 2.11 fixed date grabbing again* 2.10 fixed date grabbing* 2.9 fixed adding year to title with many years* 2.8 old style working, fixed death day for new style, improved year grabbing* 2.7 added persistent config, changed namespace* 2.6 fixed star signs and added unicode symbols* 2.5 fixed imdb updates* 2.4 fixed imdb updates* 2.3 improved year grabbing* 2.2 updated imdb text info, formatting, added ages to individual films* 2.1 Major changes, added signs, added config* 1.6 Added improvement ideas from Christopher J. Madsen, Added first imdb text files search, reformatting* 1.5 Removed function enclosing while script* 1.3 First public version*/var doNameAge  = true;var doNameAges = true;var doSigns    = true;var doFilmAge  = true;// ==UserScript==// @name        IMDBAge// @description Adds the age and other various info onto IMDB pages.// @version     2.14// @author      Thomas Stewart// @namespace   http://www.stewarts.org.uk// @include     http*://*imdb.com/name/*// @include     http*://*imdb.com/title/*// @homepageURL https://stewarts.org.uk/project/imdbage/// @icon        https://stewarts.org.uk/project/imdbage/icon.png// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt// ==/UserScript==/*(https://secure.imdb.com/register-imdb/siteprefs)Title Test Cases:plain year              https://www.imdb.com/title/tt0056172/year range              https://www.imdb.com/title/tt0108757/year range still open   https://www.imdb.com/title/tt0944947/year with version       https://www.imdb.com/title/tt1008690/ (dead)Name Test Cases: (In full for completeness)Born 18C -> Died 18C    https://www.imdb.com/name/nm1038177/ (Laurence Sterne 54)Born 18C -> Died 19C    https://www.imdb.com/name/nm0308075/ (Almeida Garrett 55)Born 18C -> Died 20C    NoneBorn 18C -> Died 21C    NoneBorn 18C -> Alive       NoneBorn 19C -> Died 19C    https://www.imdb.com/name/nm0786564/ (Anna Sewell 58)Born 19C -> Died 20C    https://www.imdb.com/name/nm0186440/ (Ward Crane 38)Born 19C -> Died 21C    https://www.imdb.com/name/nm0041807/ (Germaine Auger 112)Born 19C -> Alive       https://www.imdb.com/name/nm0008724/ (Dawlad Abiad 118)Born 20C -> Died 20C    https://www.imdb.com/name/nm0001006/ (John Candy 43)Born 20C -> Died 21C    https://www.imdb.com/name/nm0670239/ (John Peel 65)Born 20C -> Alive       https://www.imdb.com/name/nm0088127/ (Alexis Bledel 36)Born 21C -> Died 21C    https://www.imdb.com/name/nm2548643/ (Tabea Block 1)Born 21C -> Alive       https://www.imdb.com/name/nm1468628/ (Ben Want 15)Born 31 Dec 1969        https://www.imdb.com/name/nm1009503/ (Taylor McCall 48)Died 31 Dec 1969        https://www.imdb.com/name/nm0862239/ (Carol Thurston 49)Born  1 Jan 1970        https://www.imdb.com/name/nm0231191/ (Fiona Dolman 48)Died  1 Jan 1970        https://www.imdb.com/name/nm0902025/ (Eduard von Borsody 71)http://us.imdb.com/date/{month}-{day}http://us.imdb.com/search/name?birth_year={year}$ curl https://datasets.imdbws.com/name.basics.tsv.gz | gunzip > name.basics.tsv$ for c in 17 18 19 20; do awk -F'\t' '{print $3 " " $1}' name.basics.tsv | grep ^$c | awk '{print $2}' > b.$c; awk -F'\t' '{print $4 " " $1}' name.basics.tsv | grep ^$c | awk '{print $2}' > d.$c; done$ cat b.17 d.17 | sort | uniq -d #list of people born and died in 18C$ wc -l b.17 d.17 b.18 d.18 b.19 d.19 b.20 d.20353 b.17137 d.1737757 b.18921 d.18471993 b.1996672 d.194516 b.2086201 d.20698550 total$*//*TODO: add ages to individual ages of actors to a film page, very hard,http req for each one, and then a xpath on the whole r###ltTODO: add script updater support*//* calculates tropical zodiac sign see http://en.wikipedia.org/wiki/Signs_of_the_Zodiacinput:  month and dayreturns: tropical zodiac sign as string */function tropicalZodiac(month, day) {if     (month ==  3 && day >= 21 ||month ==  4 && day <= 19) { return "Aries - ♈"; }else if(month ==  4 && day >= 20 ||month ==  5 && day <= 20) { return "Taurus - ♉"; }else if(month ==  5 && day >= 21 ||month ==  6 && day <= 20) { return "Gemini - ♊"; }else if(month ==  6 && day >= 21 ||month ==  7 && day <= 22) { return "Cancer - ♋"; }else if(month ==  7 && day >= 23 ||month ==  8 && day <= 22) { return "Leo - ♌"; }else if(month ==  8 && day >= 23 ||month ==  9 && day <= 22) { return "Virgo - ♍"; }else if(month ==  9 && day >= 23 ||month == 10 && day <= 22) { return "Libra - ♎"; }else if(month == 10 && day >= 23 ||month == 11 && day <= 21) { return "Scorpio - ♏"; }else if(month == 11 && day >= 22 ||month == 12 && day <= 21) { return "Sagittarius - ♐"; }else if(month == 12 && day >= 22 ||month ==  1 && day <= 19) { return "Capricorn - ♑"; }else if(month ==  1 && day >= 20 ||month ==  2 && day <= 18) { return "Aquarius - ♒"; }else if(month ==  2 && day >= 19 ||month ==  3 && day <= 20) { return "Pisces - ♓"; }else { return ""; }}/* calculates chinese zodiac sign see http://en.wikipedia.org/wiki/Chinese_astrologyinput:  full yearreturns: chinese zodiac sign as string */function chineseZodiac(year) {/* no idea how to work out signs before 20C */if (year < 1900) { return ""; }/* there are 12 signs that go round in a rotation *//* find years since 1900, find modulus of that, get rid of the *//* sign(sic) and round it */var nsign = Math.round(Math.abs((year - 1900) % 12));if      (nsign ==  0) { return "Rat (Metal)"; }else if (nsign ==  1) { return "Ox (Metal)"; }else if (nsign ==  2) { return "Tiger (Water)"; }else if (nsign ==  3) { return "Rabbit/Cat (Water)"; }else if (nsign ==  4) { return "Dragon (wood)"; }else if (nsign ==  5) { return "Snake (Wood)"; }else if (nsign ==  6) { return "Horse (Fire)"; }else if (nsign ==  7) { return "Goat (Fire)"; }else if (nsign ==  8) { return "Monkey (Earth)"; }else if (nsign ==  9) { return "Rooster (Earth)"; }else if (nsign == 10) { return "Dog (Metal)"; }else if (nsign == 11) { return "Pig/Wild Boar (Metal)"; }else { return ""; }}/* get dates from a name pageinput: born and died called by ref, they are filled with dates from the pagereturns: whether they are dead or alive */function getNameDates(born, died) {var alive = true;/* if new style */if (newStyle()) {var nodes = document.evaluate("//script[@type='application/ld+json']",document, null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE, null);if (nodes.snapshotLength == 1) {jsond = JSON.parse(nodes.snapshotItem(0).firstChild.textContent);/* find the birth date */date = jsond.birthDate.split("-");born.setFullYear(date[0]);born.setMonth(date[1] - 1);born.setDate(date[2]);/* find the death date */date = jsond.deathDate;if(date) {date = date.split("-")died.setFullYear(date[0]);died.setMonth(date[1] - 1);died.setDate(date[2]);alive = false;}}/* else old style */} else {/* find the birth date */var nodes = document.evaluate("//div[contains(@class,'info-content')]/a[contains(@href,'birth')]",document, null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE,null);if (nodes.snapshotLength == 3) {monthday = nodes.snapshotItem(0).getAttribute("href")month = monthday.substring(28, 30)day = monthday.substring(31, 33)year = nodes.snapshotItem(1).getAttribute("href")year = year.substring(24, 28);born.setFullYear(year);born.setMonth(month - 1);born.setDate(day);alive = true}/* find the death date */var nodes = document.evaluate("//div[contains(@class,'info-content')]/a[contains(@href,'death')]",document, null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE,null);if (nodes.snapshotLength == 2) {monthday = nodes.snapshotItem(0).getAttribute("href")month = monthday.substring(6, 8)day = monthday.substring(09,11)year = nodes.snapshotItem(1).getAttribute("href")year = year.substring(24, 28);died.setFullYear(year);died.setMonth(month - 1);died.setDate(day);alive = false}}//alert("Born: " + born + "\nDied: " + died + "\nAlive: " + alive);return alive;}/* get dates from a title pageinput: nonereturns: date of title */function getTitleDates() {var nodes = document.evaluate("//h4[text()='Release Date:']",document, null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE, null);if (nodes.snapshotLength == 1) {date = nodes.snapshotItem(0).nextSibling.textContent;}var nodes = document.evaluate("//a[text()='Release date']",document, null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE, null);if (nodes.snapshotLength == 1) {date = nodes.snapshotItem(0).nextSibling.textContent;}titledate = new Date(Date.parse(date));//alert("Year: " + titledate.getFullYear())return titledate;}/* add age of person to pageinput: alive status, and datesreturns: none */function addAge(alive, born, died) {var justyear;/* find the difference between two times */var age;if (died == undefined) {age = new Date() - born.getTime();} else {age = died.getTime() - born.getTime();}//alert("Born: " + born + "\nDied: " + died + "\nAlive: " + alive);/* convert difference into years */age = age / (1000 * 60 * 60 * 24 * 365.242199);/* get nice values */var years =  Math.floor( age );var months = Math.floor( (age - years) * 12 );var nodes = document.evaluate("//a[contains(@href,'/date')]",document, null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE, null);/* only print the year if there aren't dates */if ((alive == true && nodes.snapshotLength == 1) ||(alive == false && nodes.snapshotLength == 2)) {justyear = false;} else {justyear = true;}/* loop over all the a tags involving dates */var nodes = document.evaluate("//a[contains(@href,'birth_year')] | //a[contains(@href,'death_date')]",document, null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE, null);/* only count months if we found month & day info */var container = document.createTextNode(" (Age: " + years + " year" + (years == 1 ? '' : 's') +(!justyear ? ", " + months + " month" + (months == 1 ? '' : 's') : '') + ")");/* loop over all dates */if (alive == true) {node = nodes.snapshotItem(0);node.parentNode.insertBefore(container, node.nextSibling);} else {node = nodes.snapshotItem(1);//only add death age on old layout, as new layout has it!if (!newStyle()) {node.parentNode.insertBefore(container, node.nextSibling);}}}/* add age of film and the age of the actor when they were in the filminput: datereturns: none */function addAges(born) {//find all the films, this in includes things like producer and writervar nodes = document.evaluate(/* new style and old style */"//span[contains(@class,'year_column')]|//div[@id='tn15content']/div/ol/li",document, null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE, null);//loop round each filmfor (var i = 0; i < nodes.snapshotLength; i++) {var node = nodes.snapshotItem(i);//extract the year of the film depending on styleif (newStyle()) {yearindex = node.innerHTML.search("[1-2][0-9]{3}")//if we don't find a year, continue with for loopif (yearindex < 0) {continue;}} else {yearindex = node.innerHTML.search("[1-2][0-9]{3}[/I]{0,2}[)]")}var filmborn = node.innerHTML.substring(yearindex,yearindex + 4);//alert(filmborn);//calculate agesvar filmage = new Date().getFullYear() - filmborn;var age = filmborn - born;age = new String(age +" year" + (age == 1 ? '' : 's') + " old");//get them in a nice formatif (filmage < 0) {var agetxt = new String("in " +Math.abs(filmage) + " year" +(Math.abs(filmage) == 1 ? '' : 's') +" will be " + age);}if (filmage == 0) {var agetxt = new String("this year while " + age);}if (filmage > 0) {var agetxt = new String(Math.abs(filmage) + " year" +(Math.abs(filmage) == 1 ? '' : 's') +" ago while " + age);}//if(i == 4) { alert(agetxt); }/* add in age text */node.innerHTML = node.innerHTML.substring(0,yearindex)+ agetxt + ", " + node.innerHTML.substring(yearindex)}}/* adds signs to pageinput: date person is bornreturns: none */function addSigns(born) {/* find place to stick the info */var nodes = document.evaluate( "//a[contains(@href,'birth_year')]",document, null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE, null);/* make a node with info in */var container = document.createTextNode(", Tropical Zodiac Sign: " + tropicalZodiac(born.getMonth() + 1, born.getDate()) +", Chinese Zodiac Sign: " + chineseZodiac(born.getFullYear()));/* should be the first occurance of the latter */var node = nodes.snapshotItem(0);/* attach it */if (nodes.snapshotLength > 0) {node.parentNode.insertBefore(container, node.nextSibling);}}/* add the age of the film to the pageinput: date of filmreturns: none */function addFilmAge(filmAge) {/* calc age */var age = new Date().getFullYear() - filmAge.getFullYear();/* only print if age is 1 or over */if (age >= 1) {/* make a node with info in */var container = document.createTextNode(", " +age +" year" + (age == 1 ? '' : 's') +" ago");}if (age == 0) {var container = document.createTextNode(", This year");}if (age <= -1) {var container = document.createTextNode(", in " +Math.abs(age) +" year" + (Math.abs(age) == 1 ? '' : 's'));}/* find place to stick the info */var nodes = document.evaluate(/* old style and new style */"//div[contains(@id,'tn15title')]//a[contains(@href,'year')]|//div[@class='subtext']/a[@title='See more release dates']|//div[contains(@class,'TitleBlock__TitleMetaDataContainer')]/ul/li",document, null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE, null);/* create new span with formatting to match */var span = document.createElement('span');span.style.fontSize = "11px";span.appendChild(container);/* should be the first occurrence of the latter */var node = nodes.snapshotItem(0);/* attach it */node.parentNode.insertBefore(span, node.nextSibling);}/* find out if we are using the newstyle on not, works on name and title pagesinput: nonereturns: true if using the new style */function newStyle() {var nodes = document.evaluate( "//div[@id='tn15content']", document,null, XPathR###lt.ORDERED_NODE_SNAPSHOT_TYPE, null);if (nodes.snapshotLength == 1) {return false} else {return true}}/* code starts, two options, either it is a name page ... */if (window.location.href.indexOf('name') != -1) {born = new Date();died = new Date();/* get needed dates */var alive = getNameDates(born, died);/* add wanted bits */if(doSigns == true) {addSigns(born);}if(doNameAge == true) {addAge(alive, born, died);}if(doNameAges == true) {addAges(born.getFullYear());}/* ... or it is a title page */} else if (window.location.href.indexOf('title') != -1) {/* get needed dates */filmAge = getTitleDates();/* add wanted bits */if(doFilmAge == true && typeof(filmAge) == "object") {addFilmAge(filmAge);}}