贴吧查水表

查看百度贴吧某用户名在全网的发言

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name   贴吧查水表
// @namespace   www.tjsky.net
// @include     http://tieba.baidu.com/p/*
// @include     http://tieba.baidu.com/f?ct*
// @include     https://tieba.baidu.com/p/*
// @include     https://tieba.baidu.com/f?ct*
// @version     1.5
// @run-at document-end
// @description 查看百度贴吧某用户名在全网的发言
// ==/UserScript==
var $ = unsafeWindow.$;

function getUserHistoryB(e){
	var userName = (JSON.parse(e.target.getAttribute('data'))).un;
	window.open("https://www.baidu.com/s?wd=\"" + encodeURIComponent(userName) + "\" site:tieba.baidu.com");
}
function getUserHistoryG(e){
	var userName = (JSON.parse(e.target.getAttribute('data'))).un;
	window.open("https://www.google.com/search?q=\"" + encodeURIComponent(userName) + "\" site:tieba.baidu.com&safe=off&hl=zh-CN&lr=lang_zh-CN");
}
function getUserHistoryM(e){
	var userName = (JSON.parse(e.target.getAttribute('data'))).un;
	window.open("https://www.bing.com/search?q=\"" + encodeURIComponent(userName) + "\" site:tieba.baidu.com&safe=off&hl=zh-CN&lr=lang_zh-CN");
}


(function addBtn(){
	$('.d_author .p_author').each(function(){
		var data = this.querySelector('.p_author_name').getAttribute('data-field');
		$(this).append('<li class="user_post_list" style="margin-top:4px"><a style="cursor: pointer;color:#FF6600;" data='+data+'>百度全网发言</a></li>')
		$(this).append('<li class="user_post_list" style="margin-top:4px"><a style="cursor: pointer;color:#FF6600;" data='+data+'>谷歌全网发言</a></li>')
        $(this).append('<li class="user_post_list" style="margin-top:4px"><a style="cursor: pointer;color:#FF6600;" data='+data+'>必应全网发言</a></li>')
		this.querySelectorAll('.user_post_list a')[0].addEventListener('click',getUserHistoryB)
		this.querySelectorAll('.user_post_list a')[1].addEventListener('click',getUserHistoryG)
        this.querySelectorAll('.user_post_list a')[2].addEventListener('click',getUserHistoryM)
	});
})();