Wikitube - YouTube on Wikipedia & 百度百科

Adds relevant YouTube videos to Wikipedia & 百度百科

  1. // ==UserScript==
  2. // @name Wikitube - YouTube on Wikipedia & 百度百科
  3. // @name:zh-CN Wikitube - YouTube on 维基百科 & 百度百科
  4. // @name:zh-TW Wikitube - YouTube on 維基百科 & 百度百科
  5. // @namespace WYOWW
  6. // @version 3.3.10
  7. // @description Adds relevant YouTube videos to Wikipedia & 百度百科
  8. // @description:zh-cn Adds relevant YouTube videos to 维基百科 & 百度百科
  9. // @description:zh-TW Adds relevant YouTube videos to 維基百科 & 百度百科
  10. // @include http*://*.wikipedia.org/wiki*
  11. // @include http*://baike.baidu.com/item/*
  12. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  13. // @author Mark Dunne | http://markdunne.github.io/ | https://chrome.google.com/webstore/detail/wikitube/aneddidibfifdpbeppmpoackniodpekj
  14. // @developer vinc, drhouse
  15. // @icon https://en.wikipedia.org/static/favicon/wikipedia.ico
  16. // ==/UserScript==
  17.  
  18. $(document).ready(function () {
  19.  
  20. const YOUTUBE_DATA_API_CREDENTIAL_1 = 'AIzaSyCMR8K-6fANDUBdlbHxFAo57mmlfAnPVFw';
  21.  
  22. // pages of wikipedia which should disable Wikitube
  23. var banned_paths = [
  24. '/wiki/Main_Page',
  25. ];
  26. var banned_paths_prefix = [
  27. '/wiki/Help:',
  28. '/wiki/Wikipedia:',
  29. '/wiki/User:',
  30. '/wiki/Special:'
  31. ];
  32.  
  33. function addGlobalStyle(css) {
  34. var head, style;
  35. head = document.getElementsByTagName('head')[0];
  36. if (!head) { return; }
  37. style = document.createElement('style');
  38. style.type = 'text/css';
  39. style.innerHTML = css;
  40. head.appendChild(style);
  41. }
  42.  
  43. addGlobalStyle('#wikitube_container { padding-bottom: 30px; overflow-y:hidden; white-space: nowrap; }');
  44. addGlobalStyle('#wikitube_container::-webkit-scrollbar { width: 0px; background: transparent; }');
  45. addGlobalStyle('#wikitube_container div { width: auto; height: 200px; margin-right: 5px; display: inline-block; box-shadow: 0 0 5px #888; }');
  46. addGlobalStyle('#wikitube_container .plusBtn { width: 100px; text-align: center; border-radius: 5px; background-color: rgb(192, 62, 62); background-position: center; background-repeat: no-repeat; cursor: pointer;}');
  47. addGlobalStyle('#wikitube_container .plusBtn:hover { background-color: rgb(192, 92, 92); }');
  48.  
  49. var allow_path = function(path){
  50. console.log(path);
  51. for (var i = 0; i < banned_paths_prefix.length; i++){
  52. if(path.startsWith(banned_paths_prefix[i])){
  53. return false;
  54. }
  55. }
  56. for (var i = 0; i < banned_paths.length; i++) {
  57. if(path == banned_paths[i]){
  58. return false;
  59. }
  60. }
  61. return true;
  62. }
  63.  
  64. var title_text;
  65. var num_videos_to_load;
  66. var num_videos_loaded = 0;
  67. var more_videos_button = $('<div class="plusBtn" title="Load more videos!"></div>');
  68. var container = $('<div id="wikitube_container"></div>');
  69.  
  70. var first_load = function(){
  71. if( $('#mw-content-text').length ){ // wikipedia
  72. container.insertBefore('#mw-content-text');
  73. }else if( $('.main-content').length ){ // 百度百科
  74. container.insertBefore('.main-content');
  75. }
  76. container.append(more_videos_button);
  77.  
  78. var plusImgURL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtv\
  79. UhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcA\
  80. YCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANg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vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAMZQTFRFERER////ERERE\
  97. RERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER\
  98. ERERERERERERERERERERERERERERERERERERERERERERlvLzngAAAEF0Uk5TAAABAgMEBQYHCAkKCwwNDg8QEhUXGBkaHR4gISMkJSYpKy4xMjM0Nzg7PUFGR0hNZWZnr7fHyNrb5ufo8vP19v4deCuTAAACGklEQVRYw+2XWXOiQBSFnV6jgmy2gqC4oSgGY3RMJjEL//9PxQAd\
  99. DTFTtD0PTlXO65WvKLvv4ZzKL0lVLgJQOS0AIMKEEIwgAKd/8jcAgJhWFU03dE2pUQyBIAAgWtetltNxO07L0usUASEAQFcNy/aHk2k4nQx922pcnSJ8C9g/r7Hu6GZ995Q83a1Xoy7TThG+BxC16cfbhOt37DdVIgCAVdNdPCQH/Vm4ZhWWByCFDTbJsTYDpqDyAKzZwcsnwEtga\
  100. 7g8gBhumHxW6BqkPICa3qwAmHkmFQH05gXAvPcDuHxAZj80l8r6UQEQ9ZmaTw8edQAARPb2Y5i5mBfEBUAceCyfGppSJelyfwD2+6+azHa9XqZ+EC0LgGUU9LOh59rMVFN74IB3/2i6gyCczTNF8fILYBlH2XAWBgO3mRoMB0DaYP5i85yU1PNm4bMGhRwAcN3qXj8mAnq87lp1DDi\
  101. A6s5omwhpO7J1ygGwZvmrRFAr36rBHICU1nAtClgPWwrKAVhzJveigPuJo+EcQPTOdCcK2E07OuGAvQO+igJe303yX72B9H+AlPY5p9D+OIWz7sHt0T047yY6h5uY7kIssQt8G0ufxK6wjdwPxmX9YFz0A2lHkvdEeVf++bRdJEAyZEnHvK9BczcWCprSUTcN28cG8SAYtotxfysa9/\
  102. PCsTq7cEhXHl662meXrqz21SRqn1Dx/M/L9xutmnjEud3T6wAAAABJRU5ErkJggg==';
  103.  
  104. more_videos_button.css('background-image', 'url(' + plusImgURL + ')');
  105.  
  106. more_videos_button.click(function(){
  107. load_new_videos(false);
  108. });
  109.  
  110. $('iframe').ready(function(){
  111. vinc_set_horiz_scroll();
  112. });
  113. }
  114.  
  115. var load_new_videos = function(is_first_load){
  116. var url = 'https://www.googleapis.com/youtube/v3/search?part=snippet&q='+title_text+'&key=' + YOUTUBE_DATA_API_CREDENTIAL_1 + '&maxResults='+(num_videos_loaded+num_videos_to_load);
  117. $.getJSON(url, function(response){
  118. if(response['items'].length > 0){
  119. if (is_first_load) {
  120. first_load();
  121. }
  122. var new_videos = videos = response['items'];
  123. new_videos = new_videos.slice(num_videos_loaded);
  124. num_videos_loaded += num_videos_to_load;
  125. add_videos_to_page(new_videos);
  126. }
  127. });
  128. }
  129.  
  130. var add_videos_to_page = function(new_videos){
  131. for (var i = 0; i < new_videos.length; i++) {
  132. video = new_videos[i];
  133. var videoHtml = '<div class="vinc_yt"><iframe width="350" height="200" frameborder="0" allowfullscreen src="//www.youtube.com/embed/'+video['id']['videoId']+'"></iframe></div>';
  134. more_videos_button.before(videoHtml);
  135. };
  136. }
  137.  
  138. var test_func = function(){
  139. url = 'https://www.googleapis.com/youtube/v3/search?part=snippet&q=memes&key=' + YOUTUBE_DATA_API_CREDENTIAL_1;
  140. $.getJSON(url, function(response){
  141. console.log(response);
  142. })
  143. }
  144.  
  145. var vinc_set_horiz_scroll = function(){
  146. $('#wikitube_container').on('mousewheel DOMMouseScroll', function(e){
  147. var delt = null;
  148.  
  149. if (e.type == 'mousewheel') {
  150. delt = (e.originalEvent.wheelDelta * -1);
  151. }
  152. else if (e.type == 'DOMMouseScroll') {
  153. delt = 40 * e.originalEvent.detail;
  154. }
  155.  
  156. if (delt) {
  157. e.preventDefault();
  158. $(this).scrollLeft(delt + $(this).scrollLeft());
  159. }
  160. });
  161. }
  162.  
  163. // main code
  164. if(allow_path(window.location.pathname)){
  165. if( $('#mw-content-text').length ){ // wikipedia
  166.  
  167. // title_text = document.getElementById('firstHeading').innerText;
  168. title_text = $("#firstHeading")[0].textContent;
  169. num_videos_to_load = Math.floor($('#bodyContent').width() / 350) + 1; //video width = 350px
  170.  
  171. // append a youtube link icon after title
  172. var search_url = "https://www.youtube.com/results?search_query=" + title_text;
  173. var youtube_icon_url = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ0AAAC7CAMAAABIKDvmAAAAh1BMVEUoKCj///8AAAAiIiJRUVElJSXp6ekHBwcYGBgaGhoWFhYeHh4LCwv4+PgSEhIODg7y8vLX19fQ0NA2NjapqamVlZWcnJytra1ubm6Dg4NLS0tmZma8vLzl5eVeXl61tbU9PT3S0tKKiop3d3fGxsZERESYmJgvLy9zc3NOTk5hYWGhoaGPj4+RKqeAAAAInUlEQVR4nO2d6XryKhSFIZFgBslg1KQa4xC1Ve//+s4miUNr9NMeCyhZf/tU4RU2i2mDsGD1KgVWs+o/90QXqxJ62icFVhaG86goJnk8HOwXizRdJuNp52s16yMCsn3jUTn8/9BstfqYjsfjZbrYDwbrXZxPimgeZpkVPJnab2kEWTgveLUXy+mqT6qKUpDn+4w5XRvkgkwQqYUeV/WP/ENM+DD4zG7XcRjzPf5VNTHUX3W2yXIxiEeTCBgFgmhYYTFap8lX3+GFoVW1XV7dX1T0aSppAaquw/yyXJSR2XS53+VRaD3WeO6iEYSTYTrdwC/iMQeqL7Xy9wgAubbDeEtl/Wk6yMPsKTSCaJgQn/qOrT6DZgGYrk89Z/W5i/7ViW7SsOKORx33RTH8kOk61O8vol/SmHQoM2XX4ckiNjUX4eM0Rsh7NxSViG1MrzWQKzQmG/89+kejTKPT3D4aaWQd+sYsuExjcS+NAX3PPvJNrN/QPC5pWF++7JIKkWnE/6YRua7scooSXf6LRm68ecQ4l5/cprEzZJdQqFhyi8ZQLxiA4/M6jVg3GBA71tdoFPrBQMgommlkTKMAehQhQSONmQa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BxJH0GjXNZWVgAmkX6ue3MNrbBVRJijDlOiYnL5CKVfl/RSvyj+GfaZaWZX1Wbll/NSP9ju1wMhnFezMPsrobwRBoX6gVZFs6jST6K491wsF+kyRg07XytZhteI5MZv5Lvlij7s9VXZzpOluliD5Ue5fkkmodhlmXWv6LB/XoajYfUC6zrCnqVJJTrP+MHf0+r6JgQAAAAAElFTkSuQmCC"
  174. $("#firstHeading").append(" &nbsp;<a href='" + search_url + "' target='_blank'><img height='17px' src='" + youtube_icon_url + "'></img></a>")
  175.  
  176. }else if( $('.main-content').length ){ // 百度百科
  177. title_text = $(".lemmaWgt-lemmaTitle-title h1")[0].textContent;
  178. num_videos_to_load = Math.floor($('.body-wrapper .content-wrapper .content').width() / 350) + 1; //video width = 350px
  179.  
  180. }
  181. load_new_videos(true);
  182. }
  183.  
  184. });