javascript:google-search-date-limiter
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
javascript:google-search-date-limiter [2009/05/07 21:27] – 0.1.2 数字を12まで増やした dgbadmin | javascript:google-search-date-limiter [2009/11/30 00:34] (現在) – greasemonkey工具箱に移動した dgbadmin | ||
---|---|---|---|
行 1: | 行 1: | ||
====== Google検索で手軽に日付範囲を指定できるようにするGreasemonkey - Google Search Date Limiter ====== | ====== Google検索で手軽に日付範囲を指定できるようにするGreasemonkey - Google Search Date Limiter ====== | ||
- | 更新履歴とコメントは[[http:// | + | [[greasemonkey/ |
- | + | ||
- | + | ||
- | [[http:// | + | |
- | + | ||
- | + | ||
- | ===== 使い方 ===== | + | |
- | インストールすると、テキストボックスと検索ボタンの間に期間を指定する選択リスト(ドロップダウンリスト)が表示される\\ | + | |
- | {{: | + | |
- | + | ||
- | 期間を指定したい時だけ、好きな期間を選択して検索すればOK。 | + | |
- | + | ||
- | + | ||
- | ===== ライセンス ===== | + | |
- | [[http:// | + | |
- | + | ||
- | + | ||
- | ===== インストール ===== | + | |
- | [[http:// | + | |
- | + | ||
- | + | ||
- | ===== ソースコード ===== | + | |
- | <code javascript> | + | |
- | // ==UserScript== | + | |
- | // @name Google search date limiter | + | |
- | // @namespace | + | |
- | // @description Always display date-range selector on results of Google Search. | + | |
- | // @version | + | |
- | // @include | + | |
- | // @include | + | |
- | // @include | + | |
- | // ==/ | + | |
- | // | + | |
- | // http:// | + | |
- | // ( The MIT License ) | + | |
- | // | + | |
- | (function(){ | + | |
- | var btn = document.getElementsByName(" | + | |
- | var insertBefore = function(elm) { | + | |
- | btn.parentNode.insertBefore(elm, | + | |
- | }; | + | |
- | + | ||
- | var selNum = document.createElement(" | + | |
- | selNum.appendChild(document.createElement(" | + | |
- | for (var i = 1; i < 13; i++) { | + | |
- | var opt = document.createElement(" | + | |
- | opt.appendChild(document.createTextNode(i)); | + | |
- | selNum.appendChild(opt); | + | |
- | } | + | |
- | insertBefore(selNum); | + | |
- | + | ||
- | var selUnit = document.createElement(" | + | |
- | var units = { | + | |
- | //d: " | + | |
- | d: " | + | |
- | } | + | |
- | for (var val in units) { | + | |
- | opt = document.createElement(" | + | |
- | opt.setAttribute(" | + | |
- | opt.appendChild(document.createTextNode(units[val] + " 以内" | + | |
- | selUnit.appendChild(opt); | + | |
- | } | + | |
- | selUnit.selectedIndex = 2; | + | |
- | insertBefore(selUnit); | + | |
- | + | ||
- | document.forms[0].addEventListener(" | + | |
- | if (!selNum.selectedIndex) { | + | |
- | return; | + | |
- | } | + | |
- | + | ||
- | var qdr = selUnit.options[selUnit.selectedIndex].value; | + | |
- | qdr += selNum.options[selNum.selectedIndex].text; | + | |
- | + | ||
- | var hdn = document.createElement(" | + | |
- | hdn.setAttribute(" | + | |
- | hdn.setAttribute(" | + | |
- | hdn.setAttribute(" | + | |
- | + | ||
- | insertBefore(hdn); | + | |
- | }, false); | + | |
- | })(); | + | |
- | </ | + |
javascript/google-search-date-limiter.1241699255.txt.gz · 最終更新: 2009/05/07 21:27 by dgbadmin