自动下载it168索爱论坛的附件
March 22nd, 2008
经常在it168索爱论坛给小6下点游戏软件之类的,但每次下载附件总会先出来一个叫你选择下载方式的页面,不知道浪费了多少我宝贵的时间。

现在自己写了个Greasemonkey脚本,终于搞定了这个问题:
脚本内容:
// ==UserScript==// @name it168 se-forum auto downloader// @namespace http://mybeky.cn/// @description 跳过下载链接选择页面,直接下载论坛附件// @include http://se*.it168.com/viewthread.php*// @include http://se*.it168.com/thread*// ==/UserScript==
/*svrId是下载方式: * 默认链接:0 *备用链接一:1 *备用链接二:2 *备用链接三:3 *备用链接四:4*/var svrId = 0;var attachmentLinks = document.evaluate("//a[@href[contains(.,'attachment.php')]]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var i = 0; i < attachmentLinks.snapshotLength; i++) { currentLink = attachmentLinks.snapshotItem(i); var attachmentURL = currentLink.href.replace("attachment", "attachments") + "&svrid=" + svrId; currentLink.setAttribute('href', attachmentURL); currentLink.setAttribute('target', '_self');}也可以在这里安装:http://userscripts.org/scripts/show/24245
现在点一下就可以下载了…
2007-03-23更新:set target property to _self
这是什么的脚本?
这是什么的脚本?
Greasemonkey
其实就是一堆js
o(n_n)o
bYc2Xb sd95vbm24r7mvu4091rvbqp