PrimeWire Movie Trailers and Reviews

#1 Most Useful Script for Primewire. Adds links to movie/TV show trailers and reviews from YouTube, IMDB and Rotten Tomatoes. Also adds new bonus site features.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
  1. // ==UserScript==
  2. // @name PrimeWire Movie Trailers and Reviews
  3. // @namespace PMTR
  4. // @description #1 Most Useful Script for Primewire. Adds links to movie/TV show trailers and reviews from YouTube, IMDB and Rotten Tomatoes. Also adds new bonus site features.
  5. // @include http://www.primewire.ag/*
  6. // @include https://www.primewire.ag/*
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  8. // @resource primefix https://greasyfork.org/scripts/8972-primewire-fix/code/primewire%20fix.user.js?version=136093
  9. // @grant GM_getResourceText
  10. // @grant GM_getValue
  11. // @grant GM_setValue
  12. // @grant GM_addStyle
  13. // @version 12
  14. // @author drhouse
  15. // @contributor arrgee
  16. // @contributor fleshTH
  17. // @icon https://www.primewire.ag/favicon.ico
  18. // ==/UserScript==
  19.  
  20. $(document).ready(function () {
  21. var siteLink,
  22. siteLink1,
  23. titleNodeList,
  24. titleNodeList1,
  25. title,
  26. title1,
  27. videos,
  28. videos1,
  29. sites = { IMDB: 'imdb.com', YouTube: 'youtube.com', RottenTomatoes: 'rottentomatoes.com' };
  30. videos = document.getElementsByClassName('index_item');
  31. for (var i = 0; i < videos.length; i++) {
  32. titleNodeList = $(videos[i].getElementsByTagName('a'));
  33. var tit = $('div.index_item > a:nth-child(1)'); //site listings
  34. if (titleNodeList.length > 0) {
  35. title = tit[i].getAttribute("title");
  36. }
  37. title = title.replace(/^\S+/g, '');
  38. title = title.replace(/\./g, '+');
  39. title = title.replace(/(\W)-[\w]*/g, '');
  40. title = title.replace(/(\W)\++[\w]*/g, '');
  41. title = title.trim();
  42. for (var site in sites) {
  43. siteLink = document.createElement('a');
  44. siteLink.textContent = site;
  45. siteLink.setAttribute('href', 'https://www.google.com/webhp#btnI&hl=en&safe=off&q=site:' + sites[site] + '+' + title);
  46. siteLink.setAttribute('class', 'nframe');
  47. siteLink.style.color = '#0980f4';
  48. siteLink.style.marginLeft = '5px';
  49. siteLink.style.fontSize = 'xx-small';
  50. titleNodeList[0].appendChild(siteLink);
  51. }
  52. }
  53. if (location.href.toString().indexOf("primewire.ag/tv") != -1) { //single TV
  54. if ($('#first > div').text() == 'Doesn\'t look like there are any links'){
  55. var votive = $('div.stage_navigation.movie_navigation > h1 > span').text(); //episode title
  56. } else {
  57. var votive = $('div.stage_navigation.movie_navigation > h1 > span > a').text(); //series title
  58. }
  59. var year = $('div:nth-child(3).movie_info > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2)').text();
  60. var air = $('div.movie_info > table > tbody > tr:nth-child(3) > td:nth-child(1) > strong').text();
  61. var released = $('tr:nth-child(2) > td:nth-child(1) > strong').text();
  62. if (released == 'Released:') { //series TV
  63. var year = $('div:nth-child(3).movie_info > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(2)').text();
  64. year = year.replace(/^\S+/g, '');
  65. year = year.replace(/..\D\D/g, '');
  66. } else if (air == 'Air Date:') {
  67. var year = $('div:nth-child(3).movie_info > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2)').text();
  68. } else {
  69. year = '';
  70. }
  71. } else {
  72. votive = $('div:nth-child(1).stage_navigation.movie_navigation').text(); //single Movie
  73. votive = votive.replace(/\s{2,}/g, ' ');
  74. year = $('div:nth-child(3).movie_info > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(2)').text();
  75. }
  76. year = year.replace(/^\S+/g, '');
  77. year = year.replace(/..\D\D/g, '');
  78. year = year.trim();
  79. votive = votive.replace(/\s{2,}/g, ' ');
  80. votive = votive.trim();
  81. title1 = votive + ' ' + '(' + year + ')';
  82. videos1 = $('div:nth-child(1).stage_navigation.movie_navigation');
  83. for (var i = 0; i < videos1.length; i++) {
  84. titleNodeList1 = $(videos1[i].getElementsByTagName('a'));
  85. for (var site in sites) {
  86. siteLink1 = document.createElement('a');
  87. siteLink1.textContent = site;
  88. siteLink1.setAttribute('href', 'https://www.google.com/webhp#btnI&hl=en&safe=off&q=site:' + sites[site] + '+' + votive);
  89. siteLink1.setAttribute('class', 'nframe');
  90. siteLink1.style.color = '#0980f4';
  91. siteLink1.style.marginLeft = '0px';
  92. siteLink1.style.fontSize = 'x-small';
  93. var subtext = $('td .clearer')[0];
  94. $(subtext).append('[ ');
  95. $(subtext).append(siteLink1);
  96. $(subtext).append(' ]');
  97. }
  98. var check = $('#first > div.tv_container > h2 > a:first').text();
  99. if (( location.href.toString().indexOf("primewire.ag/watch") > 1 || location.href.toString().indexOf("primewire.ag/tv") > 1 ) && (check == "Season 1")) {
  100. var lat = $('div.tv_episode_item').not(".transp2");
  101. var ars = $(lat).last();
  102. var nu = (ars).find('a').attr('href');
  103. var siteLink2;
  104. siteLink2 = document.createElement('a');
  105. siteLink2.textContent = 'Latest';
  106. siteLink2.setAttribute('href', 'http://www.primewire.ag' + nu);
  107. siteLink2.setAttribute('class', 'nframe');
  108. siteLink2.style.color = '#0980f4';
  109. siteLink2.style.marginLeft = '0px';
  110. siteLink2.style.fontSize = 'x-small';
  111. $(subtext).append('[ ');
  112. $(subtext).append(siteLink2);
  113. $(subtext).append(' ]');
  114. }
  115. }
  116. $(".mlink_imdb a").addClass("nframe");
  117. $(".nframe").click(function (e) {
  118. e.preventDefault();
  119. var url = $(this).attr("href");
  120. var width = screen.width * 0.75;
  121. var height = screen.height * 0.75;
  122. var left = (screen.width - width) / 2;
  123. var top = (screen.height - height) / 2;
  124. var params = 'width=' + width + ', height=' + height;
  125. params += ', top=' + top + ', left=' + left;
  126. params += ', directories=no';
  127. params += ', location=no';
  128. params += ', menubar=no';
  129. params += ', resizable=yes';
  130. params += ', scrollbars=yes';
  131. params += ', status=no';
  132. params += ', toolbar=no';
  133. newwin = window.open(url, 'subpop', params);
  134. if (window.focus) {
  135. newwin.focus()
  136. }
  137. return false;
  138. })
  139. $('.mlink_buydvd').remove();
  140. $('.addthis_toolbox').remove();
  141. var check = $('#first > div.tv_container > h2 > a').text();
  142. if ((check != "Season 1")) {eval(GM_getResourceText("primefix"))};
  143. })