Greasy Fork

New IMDB Message Boards - Moviechat

Directly integrated replacement on the IMDB message boards using moviechat.org, appears at bottom of all IMDB movie/tv page listings, includes millions of archived posts saved from before the boards closed.

目前为 2021-07-11 提交的版本。查看 最新版本

// ==UserScript==
// @name               New IMDB Message Boards - Moviechat
// @namespace          https://greasyfork.org/en/users/10118-drhouse
// @version            2.0.0
// @description        Directly integrated replacement on the IMDB message boards using moviechat.org, appears at bottom of all IMDB movie/tv page listings, includes millions of archived posts saved from before the boards closed.
// @run-at             document-ready
// @include            https://www.imdb.com/title/*
// @include            https://www.imdb.com/name/*
// @include            http://www.moviechat.org/*
// @include            https://www.moviechat.org/*
// @exclude            https://media-imdb.com/*
// @exclude            https://*.media-imdb.com/*
// @require            http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @author             drhouse
// @icon               https://www.google.com/s2/favicons?domain=imdb.com
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function () {
		var theparenturl = document.URL;

	if (theparenturl.indexOf("reference") != -1)
		theparenturl = theparenturl.replace('reference','');

	if (theparenturl.indexOf("combined") != -1)
		theparenturl = theparenturl.replace('combined','');

	var quest = theparenturl.split('?')[0];
	var parts = quest.split('/');
	var lastSegment = parts.pop() || parts.pop();

	var theurl = 'https://www.moviechat.org/movies/';

	var simple = (theurl + lastSegment);
	//console.info(simple);

	var chatdiv = $('<div></div>').css('display','block').css('overflow','hidden').css('position','relative').css('height','660px').css('width','640px');

	//var lastart = $('.article').last();
    //var lastart = $('.ipc-page-section').last()
    // var lastart = $("#__next > main > div > section.ipc-page-background.ipc-page-background--base.TitlePage__StyledPageBackground-wzlr49-0.dDUGgO > div > section")
    // var lastart = $("#__next > main > div > section.ipc-page-background.ipc-page-background--base.TitlePage__StyledPageBackground-wzlr49-0.dDUGgO > div > section > div > div.TitleMainBelowTheFoldGroup__TitleMainPrimaryGroup-sc-1vpywau-1.btXiqv.ipc-page-grid__item.ipc-page-grid__item--span-2 > section:nth-child(44)")
    var lastart = $("#__next > main > div > section.ipc-page-background.ipc-page-background--base.TitlePage__StyledPageBackground-wzlr49-0.dDUGgO").find('section :nth-child(38)')
    // var lastart =$('main > div > section:nth-child(1) > div > section > div > div:nth-child(1) > section:nth-child(9) > div:nth-child(1)')
    
	// setTimeout(function(){
        $(chatdiv).insertBefore(lastart);
    // }, 1000); 
    
	//lazy else
	// $(chatdiv).insertBefore('#tn15bot');

	var ifrm = document.createElement("iframe");
	ifrm.setAttribute("id", "msgframe");
	ifrm.setAttribute("src", simple);
	ifrm.setAttribute("style", "scrolling=no;position=absolute;padding=0px");
	ifrm.setAttribute("frameborder", "0");
	ifrm.style.height = 600+"px";
	ifrm.style.width = 640+"px";
	$(ifrm).appendTo(chatdiv);

	$('body').css('background-color','#fff');
	$('.main').css('box-shadow','0px 0px 0px 0px');


});