Created
August 18, 2009 11:52
-
-
Save cherenkov/169688 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name mod_uploader utility | |
| // @namespace http://d.hatena.ne.jp/Cherenkov/ | |
| // @include http://upload0.dyndns.org/* | |
| // ==/UserScript== | |
| //AutoPagerizeも入れておくと便利だお。 | |
| (function(){ | |
| GM_addStyle(<><![CDATA[ | |
| .input_download_pass | |
| {text-align: left!important;} | |
| table.file td | |
| {max-width:200px !important;} | |
| .description | |
| {display:none !important;} | |
| ]]></>); | |
| //キーワードにヒットしたらハイライト | |
| function highLight(doc) { | |
| var c = doc.querySelectorAll('td.name'); | |
| for(var i=0;i<c.length;i++){ | |
| if(/鶴瓶|きゃい|キャイ|翔子|松村|サイエンス|サイエンス|サンデー|日サン|にち|爆|ANN|99|ナイ|ナイ|雨|バナナ|バナナ|banana/i.test(c[i].textContent)){ | |
| c[i].parentNode.style.backgroundColor = 'yellow'; | |
| } | |
| } | |
| } | |
| highLight(document); | |
| if(window.AutoPagerize) { | |
| boot(); | |
| } else { | |
| window.addEventListener("GM_AutoPagerizeLoaded", boot, false); | |
| } | |
| function boot() { | |
| window.AutoPagerize.addFilter(function(docs) { | |
| docs.forEach(highLight); | |
| }); | |
| } | |
| })(); | |
| //個別jumpページに来たら、自動で次のページへ | |
| //jumpページを通らないと403になる。 | |
| (function(){ | |
| if(!/\/jump/.test(location.href)) return false; | |
| var c = document.querySelector('.download'); | |
| location.replace(c.href); | |
| })(); | |
| //パスワード入力のページ | |
| (function(){ | |
| if(!/\/download/.test(location.href)) return false; | |
| //パスワードが間違っていたら自動で戻る。便利! | |
| if(document.getElementById("error_message")) return window.back(); | |
| GM_addStyle(<><![CDATA[ | |
| #download_pass | |
| {font-size:30pt !important;} | |
| .__pBtn__ | |
| {font-size: large; | |
| margin: 20px 5px 0px 5px} | |
| .navigator, .footer, .package_info, .validator, .rss, | |
| .input_download_pass a, | |
| .input_download_pass iframe, | |
| .input_download_pass br | |
| {display:none !important;} | |
| ]]></>); | |
| var download = document.getElementById('download'); | |
| var download_pass = document.getElementById('download_pass'); | |
| download_pass.focus(); | |
| var createPbtn = function(label, pass) { | |
| var btn = document.createElement("input"); | |
| btn.className = "__pBtn__"; | |
| btn.type = "button"; | |
| btn.value = label; | |
| btn.addEventListener("click", function(){ | |
| download_pass.value = pass; | |
| download.submit(); | |
| }, false); | |
| var btnBox = document.getElementById("btnBox"); | |
| if(!btnBox) { | |
| var box = document.createElement("div"); | |
| box.id = "btnBox"; | |
| document.body.appendChild(box); | |
| box.appendChild(btn); | |
| } else { | |
| btnBox.appendChild(btn); | |
| } | |
| } | |
| createPbtn("junk", "junk"); | |
| createPbtn("ann", "ann"); | |
| createPbtn("1134(キャイ~ン)", "1134"); | |
| createPbtn("954(日サン)", "954"); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment