Last active
June 8, 2017 03:40
-
-
Save ymkjp/e2db5ebc850bb11b3c802f84e213e01d to your computer and use it in GitHub Desktop.
Nintendo Store Toolkit for https://store.nintendo.co.jp/customize.html
This file contains 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
#!/usr/bin/env bash | |
# Usage | |
# estimator.sh | awk -F"\t" '($2 < 400) {print $0}' | |
# $ curl -IL https://store.nintendo.co.jp/client_info/CX24DMSJKX/view/userweb/images/Nstore_banner_NX_0601_13.jpg?timestamp=1496291405000 | |
# HTTP/1.1 200 OK | |
# Accept-Ranges: bytes | |
# Cache-Control: private | |
# Content-Length: 844784 | |
# Content-Type: image/jpeg | |
# Date: Tue, 06 Jun 2017 00:32:12 GMT | |
# ETag: "114a118-ce3f0-550de7daced40" | |
# Last-Modified: Thu, 01 Jun 2017 04:30:05 GMT | |
# Server: Apache | |
# X-Content-Type-Options: nosniff | |
# Connection: keep-alive | |
HEAD_MONTH="06" | |
HEAD_DAY="08" | |
TAIL_MONTH="06" | |
TAIL_DAY="12" | |
HEAD_HOUR="00" | |
TAIL_HOUR="24" | |
IMG_URL="https://store.nintendo.co.jp/client_info/CX24DMSJKX/view/userweb/images/Nstore_banner_NX_{{MMDD_HH}}.jpg?timestamp={{TIMESTAMP}}" | |
function fetchStatus { | |
DATE=$1 | |
UNIXTIME="$(date +%s)000" | |
TARGET_URL=$(echo ${IMG_URL} | sed -e "s#{{MMDD_HH}}#${DATE}#g" | sed -e "s#{{TIMESTAMP}}#${UNIXTIME}#g") | |
echo -e "${DATE}\t$(curl -sIL ${TARGET_URL} | head -n 1 | awk '{print $2}')\t${TARGET_URL}" | |
} | |
for MONTH in $(seq -f "%02g" ${HEAD_MONTH} ${TAIL_MONTH}); do | |
for DAY in $(seq -f "%02g" ${HEAD_DAY} ${TAIL_DAY}); do | |
for HOUR in $(seq -f "%02g" ${HEAD_HOUR} ${TAIL_HOUR}); do | |
fetchStatus "${MONTH}${DAY}_${HOUR}" | |
# sleep 1 | |
done | |
done | |
done |
This file contains 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 Nintendo Store Reloader for https://store.nintendo.co.jp/customize.html | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 3.4 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/is_sold_out.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/is_sold_out.js | |
// @author ymkjp | |
// @match https://store.nintendo.co.jp/customize.html | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 120 * 1000; | |
var SELECTOR = '#HAC_S_KAYAA:not(:contains("SOLD OUT"))'; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var $target = $(SELECTOR); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(w.location.href + SELECTOR); | |
w.console.log($target, `[${count}] ${INTERVAL_MS} * ${duration_rate}`); | |
if ($target.length > 0) { | |
w.prompt(`[${count}] Successfuly loaded: "${SELECTOR}". Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
This file contains 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 7net Reloader for Switch | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 1.0 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_7net_omni7.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_7net_omni7.js | |
// @author ymkjp | |
// @match *://7net.omni7.jp/detail/2110595636* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 120 * 1000; | |
var SELECTOR = '.cartBtn > .js-pressTwice[value="販売終了"]'; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var $target = $(SELECTOR); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(w.location.href + SELECTOR); | |
w.console.log($target, `[${count}] ${INTERVAL_MS} * ${duration_rate}`); | |
if ($target.length < 1) { | |
w.prompt(`[${count}] Successfuly loaded: "${SELECTOR}". Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
This file contains 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 Amazon.co.jp Reloader for Switch | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 1.0 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_amazon_co_jp.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_amazon_co_jp.js | |
// @author ymkjp | |
// @match *://www.amazon.co.jp/dp/B01N5QLLT3/* | |
// @match *://www.amazon.co.jp/dp/B01NA08WPU/* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 120 * 1000; | |
var SELECTOR = '#priceblock_ourprice'; | |
var TARGET_PRICE = 32378 * 1.1; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var price = $(SELECTOR).text().replace(/\D+/g, ''); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(SELECTOR); | |
w.console.log(`[${count}] ${price} JPY, ${INTERVAL_MS} * ${duration_rate}`); | |
if (w.parseInt(price, 10) <= TARGET_PRICE) { | |
w.prompt(`[${count}] Price: ${price} JPY. Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
This file contains 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 Biccamera Reloader for Switch | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 1.0 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_biccamera_com.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_biccamera_com.js | |
// @author ymkjp | |
// @match *://www.biccamera.com/bc/disp/CSfGoodsPage_001.jsp?GOODS_NO=3658121* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 120 * 1000; | |
var SELECTOR = '#RIGHT-SIDE:not(:contains("予約受付は終了"))'; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var $target = $(SELECTOR); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(w.location.href + SELECTOR); | |
w.console.log($target, `[${count}] ${INTERVAL_MS} * ${duration_rate}`); | |
if ($target.length > 0) { | |
w.prompt(`[${count}] Successfuly loaded: "${SELECTOR}". Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
This file contains 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 Nintendo Store Reloader for https://store.nintendo.co.jp/customize.html | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 2.1 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://rawgit.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/e06e2859b8c103e8dc1efe2965d78a768018abf1/reload_nintendo_store.js | |
// @updateURL https://rawgit.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/e06e2859b8c103e8dc1efe2965d78a768018abf1/reload_nintendo_store.js | |
// @author ymkjp | |
// @match https://store.nintendo.co.jp/* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 30 * 1000; | |
var TARGET_ELEMENT = '#error:contains("ただいまサイトが大変混雑しています。しばらく待ってから、再度アクセスしてください。")'; | |
var $error; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
$(function() { | |
$error = $(TARGET_ELEMENT); | |
w.console.log(w.location); | |
w.console.log($error); | |
if ($error.length > 0) { | |
reloadLater(INTERVAL_MS * w.Math.random()); | |
} else { | |
w.prompt('Successfuly loaded. Stop the script and proceed purchasing! Loaded UNIX time:', w.Date.now()); | |
} | |
}); | |
}(window)); |
This file contains 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 Nojima Reloader for Switch | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 1.0 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_nojima_co_jp.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_nojima_co_jp.js | |
// @author ymkjp | |
// @match *://online.nojima.co.jp/4902370537338/1/cd/* | |
// @match *://online.nojima.co.jp/4902370535709/1/cd/* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 60 * 1000; | |
var SELECTOR = '#shohin-contents:not(:contains("完売御礼"))'; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var $target = $(SELECTOR); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(w.location.href + SELECTOR); | |
w.console.log($target, `[${count}] ${INTERVAL_MS} * ${duration_rate}`); | |
if ($target.length > 0) { | |
w.prompt(`[${count}] Successfuly loaded: "${SELECTOR}". Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
This file contains 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 Sofmap Reloader for Switch | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 1.0 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_sofmap_com.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_sofmap_com.js | |
// @author ymkjp | |
// @match *://www.sofmap.com/product_detail.aspx?sku=13266080&gid=GF44010000* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 120 * 1000; | |
var SELECTOR = '.product-detail-zaikocoment > img[alt="在庫切れ"]'; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var $target = $(SELECTOR); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(w.location.href + SELECTOR); | |
w.console.log($target, `[${count}] ${INTERVAL_MS} * ${duration_rate}`); | |
if ($target.length < 1) { | |
w.prompt(`[${count}] Successfuly loaded: "${SELECTOR}". Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
This file contains 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 Toysrus Reloader for Switch | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 1.0 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_toysrus_co_jp.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_toysrus_co_jp.js | |
// @author ymkjp | |
// @match *://www.toysrus.co.jp/s/dsg-572182200* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 120 * 1000; | |
var SELECTOR = '#isStock_c[hidden]'; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var $target = $(SELECTOR); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(w.location.href + SELECTOR); | |
w.console.log($target, `[${count}] ${INTERVAL_MS} * ${duration_rate}`); | |
if ($target.length > 0) { | |
w.prompt(`[${count}] Successfuly loaded: "${SELECTOR}". Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
This file contains 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 Tsutaya Reloader for Switch | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 1.0 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_tsutaya_co_jp.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_tsutaya_co_jp.js | |
// @author ymkjp | |
// @match *://shop.tsutaya.co.jp/Nintendo-Switch-Joy-Con-L-R-%E3%82%B0%E3%83%AC%E3%83%BC-HACSKAAAA/product-game-4902370535709/* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 120 * 1000; | |
var SELECTOR = '#pbBlock4291298:not(:contains("在庫なし"))'; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var $target = $(SELECTOR); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(w.location.href + SELECTOR); | |
w.console.log($target, `[${count}] ${INTERVAL_MS} * ${duration_rate}`); | |
if ($target.length > 0) { | |
w.prompt(`[${count}] Successfuly loaded: "${SELECTOR}". Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
This file contains 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 Yodobashi Reloader for Switch | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 1.0 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_yodobashi_com.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_yodobashi_com.js | |
// @author ymkjp | |
// @match *://www.yodobashi.com/product/100000001003431565/* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 120 * 1000; | |
var SELECTOR = '#js_buyBoxMain:not(:contains("販売休止中です"))'; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var $target = $(SELECTOR); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(w.location.href + SELECTOR); | |
w.console.log($target, `[${count}] ${INTERVAL_MS} * ${duration_rate}`); | |
if ($target.length > 0) { | |
w.prompt(`[${count}] Successfuly loaded: "${SELECTOR}". Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
This file contains 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 Yodobashi Reloader for Splatoon | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 1.0 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_yodobashi_splatoon.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/reload_yodobashi_splatoon.js | |
// @author ymkjp | |
// @match *://www.yodobashi.com/product/100000001003570628/* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 120 * 1000; | |
var SELECTOR = '#js_buyBoxMain:not(:contains("予約受付を終了しました"))'; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var $target = $(SELECTOR); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(w.location.href + SELECTOR); | |
w.console.log($target, `[${count}] ${INTERVAL_MS} * ${duration_rate}`); | |
if ($target.length > 0) { | |
w.prompt(`[${count}] Successfuly loaded: "${SELECTOR}". Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
This file contains 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 Yamada-denki Reloader for Switch | |
// @namespace https://gist.github.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d | |
// @version 1.3 | |
// @description Install this script to Tampermonkey and get Switch. Hope, Hope, Hope! | |
// @downloadURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/yamada_denki_reloader.js | |
// @updateURL https://gist.githubusercontent.com/ymkjp/e2db5ebc850bb11b3c802f84e213e01d/raw/yamada_denki_reloader.js | |
// @author ymkjp | |
// @match *://www.yamada-denkiweb.com/1178028018* | |
// @match *://www.yamada-denkiweb.com/1177991016* | |
// @require https://code.jquery.com/jquery-3.2.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function(w) { | |
'use strict'; | |
var INTERVAL_MS = 120 * 1000; | |
var SELECTOR = '.side_cart_btn:not(:contains("売り切れました"))'; | |
var VALID_URL = /^http(s)?:\/\/www.yamada-denkiweb.com\/\d+/; | |
var REDIRECT_URL = 'http://www.yamada-denkiweb.com/1177991016'; | |
function reloadLater(ms) { | |
w.setTimeout(function(){ | |
w.location.reload(true); | |
}, ms); | |
} | |
function openPageLater(url, ms) { | |
w.setTimeout(function(){ | |
w.open(url,"_self"); | |
}, ms); | |
} | |
function incrementStats(key) { | |
var count = w.sessionStorage.getItem(key) || 0; | |
count = w.parseInt(count, 10) + 1; | |
w.sessionStorage.setItem(key, count); | |
return count; | |
} | |
$(function() { | |
var $target = $(SELECTOR); | |
var duration_rate = w.Math.random(); | |
var count = incrementStats(w.location.href + SELECTOR); | |
w.console.log($target, `[${count}] ${INTERVAL_MS} * ${duration_rate}`); | |
if (!VALID_URL.test(w.location.href)) { | |
openPageLater(REDIRECT_URL, INTERVAL_MS * duration_rate); | |
} | |
if ($target.length > 0) { | |
w.prompt(`[${count}] Successfuly loaded: "${SELECTOR}". Stop the script and proceed purchasing! Loaded UNIX time:`, | |
w.Date.now()); | |
} else { | |
reloadLater(INTERVAL_MS * duration_rate); | |
} | |
}); | |
}(window)); |
Author
ymkjp
commented
Jun 1, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment