|
阅读:2597回复:2
about greasemonkey ; bbcode 0.4.1.3
1.bbcode0413这个扩展在dvbbs论坛怎么用?
2.下面这个在greasemonkey里用的扩展有高手能修理修理用在dvbbs吗? // IGN Boards Killfile |
|
|
1楼#
发布于:2005-12-01 16:36
难道用法和一般的论坛还不一样吗?
从来没上过dvbbs的论坛 |
|
|
2楼#
发布于:2005-12-01 16:36
改了一下,只在云宵和快读试过,Greasemonkey0.5.3,文件要保存为UTF-8格式。
Greasemonkey0.6.x肯定会不行,若代码中有中文字符,就会发生错误! @include要你自己改。 // IGN Boards Killfile
// version 0.1
// 2005-06-08
// Copyright (c) 2005, Michael Stephens (michaeljs@gmail.com)
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// A simple GreaseMonkey user script to ignore posts of certain users on the IGN
// message boards. To ignore a user, simply add them to the list below. If the
// script is already installed, this can be acomplished by going to
// Tools->Manage Scripts, selecting the IGN Boards Killfile, and
// pressing the "Edit" button.
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// --------------------------------------------------------------------
// Modify by sunwan ------2005.12.2
//
// ==UserScript==
// @name Dvbbs Kill User
// @namespace http://mikejs.no-ip.org/code/greasemonkey
// @description allows you to ignore posts from specific users
// @include http://bbs*/dispbbs.asp?*
// ==/UserScript==
// ADD YOUR IGNORES HERE:
list = new Array("AirNik", "张三");
var m = document.evaluate('//meta[@content="dvbbs"]', document, null,XPathResult.ANY_UNORDERED_NODE_TYPE, null);
if ( m ) {
killUser();
}
function killUser() {
var xpath = "//div[@class='postlary1'] | //div[@class='postlary2']";
var allDivs, thisDiv, thisAuthor;
allDivs = document.evaluate(xpath, document, null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < allDivs.snapshotLength; i++) {
thisDiv = allDivs.snapshotItem(i);
//alert(thisDiv.childNodes[1].childNodes[1].childNodes[1].firstChild.firstChild.firstChild.nodeValue);
thisAuthor = thisDiv.childNodes[1].childNodes[1].childNodes[1].firstChild.firstChild.firstChild.nodeValue;
for (j = 0; j < list.length; j++) {
if (thisAuthor == list[j]) {
thisDiv.nextSibling.nextSibling.innerHTML = "";
thisDiv.nextSibling.innerHTML = "";
thisDiv.innerHTML = ""
}
}
}
} |
|
|
