futaba log search

img,dat,mayのスレが消えた時に過去ログを表示しちゃう

目前为 2015-03-16 提交的版本。查看 最新版本

// ==UserScript==
// @name           futaba log search
// @namespace      https://github.com/himuro-majika
// @description    img,dat,mayのスレが消えた時に過去ログを表示しちゃう
// @include        http://img.2chan.net/b/res/*.htm
// @include        http://dat.2chan.net/b/res/*.htm
// @include        http://may.2chan.net/b/res/*.htm
// @require     http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js
// @grant       none
// @version 0.0.1.20150316073043
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);

(function ($) {
	var t = document.title;															//ページタイトル
	
	//ログ保管サービスジャンプ先URL(数字以外)
	//var logServiceURL = "http://peka.sakura.ne.jp/futaba/logbox/detail.html?no=";			//虹裏のログを数日分だけ閲覧できるサイト
	var logServiceURL_dat = "http://appsweets.net/tatelog/dat/thread/";						//リッチー(dat)
	var logServiceURL_img1 = "http://imgbako.com/";											//ふたろぐばこ(img)
	var logServiceURL_img2 = "http://parupunte.net/logbox/detail.html?no=";					//虹裏のログを数日分だけ閲覧できるサイト(img)
	var logServiceURL_may = "http://futalog.com/";											//ふたろぐばこ(may)
	
	//パターン:http://dat.2chan.net/b/res/68646178.htm
	var saba = document.domain.match(/^[^.]+/);		//鯖名(dat)
	var f = location.pathname.match(/\d+\.htm/);	//ファイル名(68646178.htm)
	var fd = f[0].match(/\d+/);						//ファイル名の数字(68646178)

	var r;						//ジャンプ先URL(フルパス)
	
	//鯖毎の振り分け
	if ( saba == "dat" )
	{
		r = logServiceURL_dat + fd;
	}
	else if ( saba == "img" )
	{
		//r = logServiceURL_img1 + f;
		r = logServiceURL_img2 + fd;
	}
	else if ( saba == "may" )
	{
		r = logServiceURL_may + f;
	}
	
	//スレが消えた時
	var waitnum = 3;	//sec
	function redirect() {
		location.href = r;								//ログ保管先にジャンプ	
	}
	if (t == "404 File Not Found")
	{
		$("body > h1").before( waitnum + "秒後に<a href='" + r + "' target='_blank'>外部ログサイト*</a>に移動します");
		setTimeout(redirect, waitnum * 1000);

	}
	else
	{
		$("body > table").before("<a href='" + r + "' target='_blank'>外部ログサイト*</a>");
	}



})(jQuery);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址