// ==UserScript== // @name IMDB+ // @description Add external links to IMDb. Every feature can be enabled/disabled in settings. // @namespace http://n-e-s.info/ // @include http://www.imdb.com/title/tt* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js // @grant GM_getValue // @grant GM_setValue // @grant GM_addStyle // @version 4.2.0 // @downloadURL https://update.greasyfork.icu/scripts/3399/IMDB%2B.user.js // @updateURL https://update.greasyfork.icu/scripts/3399/IMDB%2B.meta.js // ==/UserScript== jQuery(document).ready(function ($) { let m = {}; m.Id = getMovieId(); m.Tt = getMovieTt(); m.TtYr = getMovieTt() + "+" + getMovieYr(); let l = {}; // l.ex = ["name", "link url", "title or alt text", "image url"]; l.tmd = ["Torrentsmd", "http://torrentsmd.com/browse.php?imdb=" + m.Id, "tmd.ico"]; l.rut = ["Rutracker", "http://rutracker.org/forum/tracker.php?nm=" + m.TtYr, "rutracker.ico"]; l.tz = ["Torrentz", "http://torrentz.eu/search?f=" + m.TtYr, "torrentz.ico"]; l.tpb = ["The Pirate Bay", "http://thepiratebay.se/search/" + m.TtYr + "/0/99/200", "tpb.ico"]; l.yt = ["Youtube", "https://www.youtube.com/results?search_query=" + m.TtYr, "youtube.ico"]; l.mpdb = ["MoviePosterDB", "http://www.movieposterdb.com/movie/" + m.Id, "mpdb.ico"]; l.kp = ["Kinopoisk", "http://www.kinopoisk.ru/index.php?first=yes&kp_query=" + m.Tt, "kinopoisk.ico"]; l.cmg = ["Cinemagia", "http://www.cinemagia.ro/cauta/?q=" + m.TtYr, "cinemagia.jpg"]; l.crx = ["CinemaRx", "http://www.cinemarx.ro/cauta/filme/" + m.TtYr, "cinemarx.ico"]; l.allm = ["allMovie", "http://www.allmovie.com/search/movies/" + m.TtYr, "allm.ico"]; l.rt = ["Rotten Tomatoes", "http://www.rottentomatoes.com/alias?type=imdbid&s=" + m.Id, "rt.ico"]; l.wiki = ["Wikipedia", "http://en.wikipedia.org/wiki/" + m.Tt, "wikipedia.ico"]; l.osub = ["OpenSubs", "http://www.opensubtitles.org/en/search/sublanguageid-all/imdbid-" + m.Id, "opensubs.ico"]; l.ssc = ["Subscene", "http://subscene.com/s.aspx?q=" + m.TtYr, "subscene.ico"]; l.ggl = ["Google", "http://www.google.md/search?q=" + m.TtYr, "google.ico"]; /** * Get movie title * @returns {string} */ function getMovieTt() { return encodeURIComponent(document.title.replace(/^(.+) \((.*)([0-9]{4})(.*)$/gi, '$1')); } /** * Get movie release year * @returns {string} */ function getMovieYr() { return encodeURIComponent(document.title.replace(/^(.+) \((.*)([0-9]{4})(.*)$/gi, '$3')); } /** * Get movie id * @returns {string} */ function getMovieId() { return location.pathname.match(/title\/tt(.*?)\//i)[1]; } function IMDbPlusStyle() { let s = ` #title-overview-widget #IMDbPlus { padding: 5px 20px; } #title-overview-widget #IMDbPlus a { margin: 5px 1px; } #title-overview-widget #IMDbPlus #IMDbPlus-Feature-Settings { margin-left: 10px; } #action-box #IMDbPlus #IMDbPlus-Feature-Settings { margin-top: 10px; } #IMDbPlus-SettingsBox { display: none; margin-left: -404px; padding: 20px; position: fixed; top: 10%; left: 50%; width: 768px; z-index: 999; } #IMDbPlus-SettingsBox > h2 { font-size: 21px } #IMDbPlus-SettingsBox > h4 { font-size: 15px } #IMDbPlus-SettingsBox #IMDbPlus-Options { margin: 20px 0;} #IMDbPlus-SettingsBox #IMDbPlus-Options .IMDbPlus-OptionField label { display: inline-block; width: 150px; } #IMDbPlus-SettingsBox button { margin: 8px 0 0; } #IMDbPlus-SettingsBox #IMDbPlus-SettingsBox-Close { float: right; } .IMDbPlus-Button img { height: 16px; width: 16px; } `; GM_addStyle(s); } function IMDbPlusInit() { let featuresHTML, optionsHTML, donationHTML; featuresHTML = '