Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
ブックマークレット:TOPSY ページの自動オフセット切り替え
var countUp = 24;
var field = 'offset';
var re = new RegExp('('+field+'=)(\\d{0,})');
var offset = location.search.match(re);
var num = 0;
var href = location.href;
if (offset) {
num = parseInt(offset[2], 10)+countUp;
href = href.replace(re, "$1"+num);
} else {
href += '&'+field+'='+countUp
}
location.href = href;
Owner

tuki0918 commented Nov 3, 2013

javascript:(function(){
var d=document;
var s=d.createElement('script');
s.src='https://gist.github.com/tuki0918/7287228/raw/topsy_pager.js';
d.body.appendChild(s);
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment