Greasy Fork

Greasy Fork is available in English.

贴吧查水表

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

当前为 2017-09-05 提交的版本,查看 最新版本

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

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

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

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

您需要先安装一款用户脚本管理器扩展,例如 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.2
// @run-at document-end
// @description 查看百度贴吧某用户名在全网的发言
// ==/UserScript==
var $ = unsafeWindow.$;

function getUserHistory(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 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.querySelectorAll('.user_post_list a')[0].addEventListener('click',getUserHistory)
	});
})();