Created
November 3, 2013 05:53
-
-
Save tuki0918/7287228 to your computer and use it in GitHub Desktop.
ブックマークレット:TOPSY ページの自動オフセット切り替え
This file contains hidden or 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
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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);
})();