|
发表于 2009-10-12 13:41:40
|
显示全部楼层
it works ... sometimes.
- // ==UserScript==
- // @name rayfile
- // @include http://www.rayfile.com/*
- // ==/UserScript==
- var a = document.getElementsByTagName('a');
- for (var i = 0; i < a.length; i++ ) {
- if (/^http:\/\/www\.rayfile\.com\/zh-cn\/files\/[\w-]+\/\w+/.test(a[i].href)) {
- GM_xmlhttpRequest({
- method: 'GET',
- url: a[i].href,
- headers: {
- 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
- 'Accept': 'application/atom+xml,application/xml,text/xml',
- },
- onload: function (responseDetails) {
- var div = document.getElementsByTagName('div');
- for (var i = 0; i < div.length; i++ ) {
- if (div[i].id == 'tabinfo_3') {
- var href = responseDetails.responseText.match(/http:\/\/cachefile\d*\.rayfile\.com[^']+/);
- var cookie = responseDetails.responseText.match(/setCookie.*/);
- div[i].innerHTML = '<a href="' + href + '" onclick="' + cookie + '">下载</a>';
- break;
- }
- }
- }
- });
- break;
- }
- }
复制代码 |
|