Guest User

New IMDB Message Boards - Moviechatb

a guest
Mar 4th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name               New IMDB Message Boards - Moviechat
  3. // @namespace          https://greasyfork.org/en/users/10118-drhouse
  4. // @version            1.7b
  5. // @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.
  6. // @run-at             document-start
  7. // @include            http://*.imdb.com/title/*
  8. // @include            http://*.imdb.com/name/*
  9. // @include            http://www.moviechat.org/*
  10. // @include            https://www.moviechat.org/*
  11. // @exclude            http://m.imdb.com/*
  12. // @require            http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  13. // @author             drhouse
  14. // @icon               http://ia.media-imdb.com/images/G/01/imdb/images/favicon-2165806970._CB522736556_.ico
  15. // ==/UserScript==
  16. this.$ = this.jQuery = jQuery.noConflict(true);
  17. $(document).ready(function () {
  18.         var theparenturl = document.URL;
  19.    
  20.     if (theparenturl.indexOf("reference") != -1)
  21.         theparenturl = theparenturl.replace('reference','');
  22.    
  23.     if (theparenturl.indexOf("combined") != -1)
  24.         theparenturl = theparenturl.replace('combined','');
  25.  
  26.     var quest = theparenturl.split('?')[0];
  27.     var parts = quest.split('/');
  28.     var lastSegment = parts.pop() || parts.pop();
  29.  
  30.     var theurl = 'http://www.moviechat.org/movies/';
  31.    
  32.     var simple = (theurl + lastSegment);
  33.     //console.info(simple);  
  34.    
  35.     var chatdiv = $('<div class="article" id="boardsTeaser"><h2>Message Boards</h2>'+
  36.                     'Recent Posts'+
  37.                     '<br><br></div>').css('display','block').css('overflow','hidden').css('position','relative').css('height','660px').css('width','640px');
  38.  
  39.     var lastart = $('.article').last();
  40.     $(chatdiv).insertBefore(lastart);
  41.     //lazy else
  42.     $(chatdiv).insertBefore('#tn15bot');
  43.  
  44.     var ifrm = document.createElement("iframe");
  45.     ifrm.setAttribute("id", "msgframe");
  46.     ifrm.setAttribute("src", simple);
  47.     ifrm.setAttribute("style", "scrolling=no;position=absolute;padding=0px");
  48.     ifrm.setAttribute("frameborder", "0");
  49.     ifrm.style.height = 600+"px";
  50.     ifrm.style.width = 640+"px";
  51.     $(ifrm).appendTo(chatdiv);
  52.  
  53.     $('body').css('background-color','#fff');
  54.     $('.main').css('box-shadow','0px 0px 0px 0px');
  55.  
  56.     var title = $('#title-overview-widget > div.vital > div.title_block > div > div.titleBar > div.title_wrapper > h1').text();
  57.     var year = $('#titleYear > a').text();
  58.     $('<div class="article"><a href='+simple+'>Discuss '+title+'</a> on the Moviechat message boards »</div><hr>').insertAfter(chatdiv);
  59.     $('.contribute').css('border-top','1px;solid;#ccc');
  60.  
  61. });
Add Comment
Please, Sign In to add comment