Greasy Fork

Greasy Fork is available in English.

Bing Bangs

向必应Bing添加DuckDuckGo的Bang特性。

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Bing Bangs
// @namespace   Bing Bangs
// @description 向必应Bing添加DuckDuckGo的Bang特性。
// @include     *.bing.com/search*
// @version     1.2
// @grant       none
// ==/UserScript==

var bangs=[],search=document.getElementById('sb_form_q').value;

//BANGS
new Bang('yt','https://youtube.com/feed/subscriptions','https://www.youtube.com/results?search_query=','+');
new Bang('ddg','https://duckduckgo.com','https://duckduckgo.com/?q=','+');
new Bang('so','https://stackoverflow.com','http://stackoverflow.com/search?q=','+');
new Bang('imdb','http://imdb.com','http://www.imdb.com/find?s=all&q=','+');
new Bang('gh','https://github.com','https://github.com/search?q=','+');
new Bang('gf','http://greasyfork.icu/scripts','http://greasyfork.icu/scripts/search?q=','+');
new Bang('gg','https://google.com','https://www.google.com/search?q=','+');
new Bang('zh','https://www.zhihu.com/topic','https://www.zhihu.com/search?q=','+');
new Bang('tb','https://taobao.com','https://s.taobao.com/search?q=','+');
new Bang('db','https://douban.com','https://www.douban.com/search?q=','+');
new Bang('bd','https://baidu.com','https://www.baidu.com/s?wd=','%20');
new Bang('bl','https://bilibili.com','https://search.bilibili.com/all?keyword=','%20');
new Bang('wb','http://s.weibo.com/','http://s.weibo.com/weibo/','%2520');
//BANGS

for(var i in bangs){
  var bang=bangs[i];
  if(search.charAt(0) == '!' || search.charAt(0) == "!" )
  {
    if(search.substr(1,bang.bang.substr(0).length)==bang.bang)
    {
      if(bang.urlSearch&&search.indexOf(' ')>=0)location.assign(bang.urlSearch+search.substr(bang.bang.length+2).replace(new RegExp(' ','g'),bang.spaceReplace));
      else location.assign(bang.urlEmpty);
    }
  }
}

function Bang(bang,urlEmpty,urlSearch,spaceReplace){
  this.bang=bang;
  this.urlEmpty=urlEmpty;
  this.urlSearch=urlSearch;
  this.spaceReplace=spaceReplace;
  bangs.push(this);
}