Skip to content
Permalink
Browse files

initial commit.

add userscripts.
  • Loading branch information...
raimon49 committed Mar 13, 2010
0 parents commit defb91e7f3a27ca38acc633a2a139cf6175638b0
@@ -0,0 +1,22 @@
// ==UserScript==
// @name FeedBurner Tracking Cutter
// @description FeedBurner経由でつく?utm_sourceから始まるトラッキングパラメータをカットして再読み込みするユーザスクリプト
// @namespace http://sangoukan.xrea.jp/
// @include http://*
// @include https://*
// @author raimon
// @version 1.0.0
// ==/UserScript==
(function (){
if (!location.search) {
return;
}

var url = location.href;
var pattern = '?utm_source';

var pos = url.indexOf(pattern);
if (pos >= 0) {
location.replace(url.substr(0, pos));
}
})();
@@ -0,0 +1,28 @@
// ==UserScript==
// @name LDC rancor cool
// @description livedoor クリップで非公開じゃなくても恥ずかしくなくするスクリプト
// @namespace http://sangoukan.xrea.jp/
// @include http://clip.livedoor.com/clip/add*
// @include http://clip.livedoor.com/clip/edit*
// @author raimon
// @version 1.0.0
// ==/UserScript==
(function (){
const LABEL = "\u975e\u516c\u958b\u3058\u3083\u306a\u304f\u3066\u3082\u6065\u305a\u304b\u3057\u304f\u306a\u3044\u3082\u3093\uff01";

var chk = document.getElementById("secret_post");
if (!chk) {
return;
}

chk.value = "";
chk.checked = true;
chk.disabled = true;

var label = chk.parentNode.getElementsByTagName("label")[0];
if (!label) {
return;
}

label.innerHTML = LABEL;
})();
@@ -0,0 +1,45 @@
// ==UserScript==
// @name read two ahead feed on LDR
// @description フィードを1つ飛ばしで読み進めるためのキーを追加するスクリプト
// @namespace http://sangoukan.xrea.jp/
// @include http://reader.livedoor.com/reader/*
// @author raimon
// @version 1.0.0
// ==/UserScript==
(function (){
var w = typeof unsafeWindow !== 'undefined' ? unsafeWindow : window;

var KEY = 'S';

var State = w.State, Ordered = w.Ordered, Control = w.Control;
var touch = w.touch;
// via http://reader.livedoor.com/js/reader_main.0.3.4.js
var get_feed = function() {
var sid = State.now_reading;
if (!sid && Ordered.list) {
return Ordered.list[1];
}

var list = Ordered.list;
if (!list) return;

var offset = list.indexOfStr(sid);
var feed = list[offset+2];
return feed;
};

var read_two_ahead_subs = function() {
if (State.requested) return;

var feed = get_feed();
if (!feed) return;

State.requested = true;
touch(State.now_reading, "onclose");
Control.read(feed, Control.prefetch);
};

w.register_hook('AFTER_INIT', function() {
w.Keybind.add(KEY, read_two_ahead_subs);
});
})();
@@ -0,0 +1,75 @@
// ==UserScript==
// @name show time on LDR
// @namespace http://sangoukan.xrea.jp/
// @description Tキーで中の人に現在時刻と経過時間を表示してもらうスクリプト
// @include http://reader.livedoor.com/reader/*
// @author raimon
// @version 0.1
// ==/UserScript==
(function (){
var w = typeof unsafeWindow != 'undefined' ? unsafeWindow : window;

var SHOW_KEY = 't';

function Clock() {};

Clock.prototype.start_time = new Date().getTime();

Clock.prototype.showTime = function() {
var now = new Date();
var hms = [];
[
now.getHours(),
now.getMinutes(),
now.getSeconds()
].forEach(
function(item) {
hms.push(this.format(item));
},
this
);

return hms.join(":");
}

Clock.prototype.showPassage = function() {
var passage_time = parseInt((new Date().getTime() - this.start_time) / 1000);
var hms = [];
[
parseInt(passage_time / (60 * 60)),
parseInt((passage_time / 60) % 60),
parseInt(passage_time % 60)
].forEach(
function(item) {
hms.push(this.format(item));
},
this
);

return hms.join(":");
}

Clock.prototype.format = function(t) {
return String("00" + t).substr(-2);
}

var c = null;

w.addEventListener(
"load",
function() {
with(w) {
c = new Clock();

Keybind.add(
SHOW_KEY,
function() {
var m = "現在時刻: " + c.showTime() + " 経過時間: " + c.showPassage();
message(m);
}
);
}
},
false
);
})();
@@ -0,0 +1,23 @@
// ==UserScript==
// @name show Yahoo! News detail page
// @namespace http://sangoukan.xrea.jp/
// @description ヤフーニュースのヘッドラインを表示した時に自動で記事全文へ移動するスクリプト
// @include http://dailynews.yahoo.co.jp/fc/*
// @author raimon
// @version 1.0.1
// ==/UserScript==
(function () {
var next = $x('//div[@id="detailHeadline"]/h3/a');
if (next.length >= 1) {
location.replace(next[0].href);
}

function $x(query) {
var results = document.evaluate(query, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for(var i=0, l=results.snapshotLength, r=[]; i<l; i++) {
r.push(results.snapshotItem(i));
}

return r;
}
})();

0 comments on commit defb91e

Please sign in to comment.
You can’t perform that action at this time.