Greasy Fork

Greasy Fork is available in English.

Seach Movie from Douban

Add a movie searching field in Douban Movie

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Seach Movie from Douban
// @namespace   feifeihang.info
// @description Add a movie searching field in Douban Movie
// @include     http://movie.douban.com/subject/*
// @include     https://movie.douban.com/subject/*
// @version     3
// @grant       none
// ==/UserScript==
(function (window, document, undefined) {
  var LIST = {
    'Bilibili 哔哩哔哩': 'http://www.bilibili.com/search?keyword=',
    'Soku 搜库': 'http://www.soku.com/search_video/q_',
    'Youtube': 'https://www.youtube.com/results?search_query='
  };
  // find and trim movie title.
  var dom = document.querySelector('#content > h1:nth-child(1) > span:nth-child(1)') || document.querySelector('#content > h1:nth-child(2) > span:nth-child(1)');
  var title = dom.innerHTML;
  title = title.trim();
  // find aside bar.
  var aside = document.querySelector('.aside');
  // now create the external movie links field.
  var field = document.createElement('div');
  field.className += ' gray_ad'; // the light green color style is defined as class 'gray_ad'.
  var subject = document.createElement('h2');
  subject.innerHTML = '视频搜索  · · · · · ·';
  field.appendChild(subject);
  // now add all entities.
  for (var item in LIST) {
    var link = document.createElement('a');
    link.innerHTML = item;
    link.setAttribute('href', LIST[item] + title);
    link.setAttribute('target', '_blank');
    field.appendChild(link);
    field.innerHTML += '<br/>';
  }
  // finally, add the field to aside bar.
  aside.insertBefore(field, aside.firstChild);
}) (window, document);