Demo |
- 포스트 수가 많은 블로그의 글주소 일련번호가 5xxxxx 값으로 변경되는 몰래패치에 대응
- 100단위로 범위를 랜덤하게 끊어서,
100개 중에서 하나의 숫자를 랜덤하게 가져오므로 중간중간 번호가 비는 포스트가 많은 블로그에 유리함
Code |
<a href="javascript:void(0)" onclick="randomPost()">랜덤 포스트</a>
// 사용자 설정 시작
// 포스트 갯수가 많아서,
// 블로그의 포스트 일련번호가 십만단위로 변했는지 아닌지 구분
// 0 - No || 1 = Yes
let pdev = 1;
// 위 pdev 값이 0인 경우 lastNumber 값을 0으로 지정
// 위 pdev 값이 1인 경우 십만 단위로 바뀌기 전 일련번호의 마지막값
let lastNumber = 13935;
// 위 pdev 값이 0인 경우 newNumber 값을 0으로 지정
// 위 pdev 값이 1인 경우 십만 단위로 바뀐 일련번호의 시작값
let newNumber = 521541;
// 단축키 키 지정 || 대소문자 가지리 않음
let hk = 'R';
// 사용자 설정 끝
const _0x39ef2f=_0x22b2;(function(_0x24efb1,_0x1756fa){const _0x4061a5=_0x22b2,_0x4a5569=_0x24efb1();while(!![]){try{const _0x2a6606=parseInt(_0x4061a5(0x107))/0x1+parseInt(_0x4061a5(0x113))/0x2*(-parseInt(_0x4061a5(0xfe))/0x3)+parseInt(_0x4061a5(0x111))/0x4+-parseInt(_0x4061a5(0x109))/0x5+-parseInt(_0x4061a5(0x114))/0x6+parseInt(_0x4061a5(0x11b))/0x7+parseInt(_0x4061a5(0x118))/0x8;if(_0x2a6606===_0x1756fa)break;else _0x4a5569['push'](_0x4a5569['shift']());}catch(_0x35f5e6){_0x4a5569['push'](_0x4a5569['shift']());}}}(_0x3bb3,0xf0d27));let lastPost,pdevOpt;if(pdev==0x0)pdevOpt=0x0;else pdev==0x1&&(pdevOpt=0x1);function _0x22b2(_0x45d63c,_0x3491a4){const _0x3bb3cd=_0x3bb3();return _0x22b2=function(_0x22b244,_0x3e8820){_0x22b244=_0x22b244-0xfa;let _0x2f655e=_0x3bb3cd[_0x22b244];return _0x2f655e;},_0x22b2(_0x45d63c,_0x3491a4);}sessionStorage[_0x39ef2f(0x119)](_0x39ef2f(0x104))==null&&fetch(location[_0x39ef2f(0x10b)]+_0x39ef2f(0x106))[_0x39ef2f(0xfb)](_0x146a22=>_0x146a22[_0x39ef2f(0x117)]())[_0x39ef2f(0xfb)](_0x593b79=>{const _0x56146c=_0x39ef2f;let _0x4be0b0=new DOMParser(),_0x26a217=_0x4be0b0[_0x56146c(0x105)](_0x593b79,_0x56146c(0x10e));lastPost=_0x26a217[_0x56146c(0xfc)]('item\x20link')[_0x56146c(0x11a)],lastPost=lastPost[_0x56146c(0x100)](_0x56146c(0x108)),lastPost=Number(lastPost[0x1]),sessionStorage[_0x56146c(0x10c)](_0x56146c(0x104),lastPost);});let range,rsn,ren,target,tUrl;function getRange(_0x303eed,_0x1c8031){const _0x2055bc=_0x39ef2f;range=Math[_0x2055bc(0x101)](Math[_0x2055bc(0x10f)]()*(_0x1c8031-_0x303eed+0x1)+_0x303eed),range=range*0x64;if(pdev==0x0)lastNumber=sessionStorage[_0x2055bc(0x119)](_0x2055bc(0x104));else pdev>0x0&&(lastNumber=lastNumber);if(range<=lastNumber)rsn=range-0x63,ren=range;else range>lastNumber&&(rsn=newNumber,ren=Number(sessionStorage[_0x2055bc(0x119)](_0x2055bc(0x104))));getTarget(rsn,ren);}function getTarget(_0x5b9fe4,_0x4bda6e){const _0xa44ddf=_0x39ef2f;target=Math[_0xa44ddf(0x101)](Math['random']()*(_0x4bda6e-_0x5b9fe4+0x1)+_0x5b9fe4);}async function randomPost(){const _0x4e9ec6=_0x39ef2f;getRange(0x1,''+Math[_0x4e9ec6(0x116)](lastNumber/0x64+pdevOpt)),tUrl=location[_0x4e9ec6(0x10b)]+'/'+target;let _0x38706b=await fetch(tUrl);_0x38706b['ok']?location[_0x4e9ec6(0x102)]=tUrl:randomPost();}document[_0x39ef2f(0xfd)](_0x39ef2f(0x10d),_0x2d9534=>{const _0x32de33=_0x39ef2f;document[_0x32de33(0x103)][_0x32de33(0x110)]!=_0x32de33(0x10a)&&document[_0x32de33(0x103)][_0x32de33(0x110)]!='INPUT'&&!_0x2d9534[_0x32de33(0xff)]&&!_0x2d9534[_0x32de33(0xfa)]&&(_0x2d9534[_0x32de33(0x112)][_0x32de33(0x115)]()==hk[_0x32de33(0x115)]()&&randomPost());});function _0x3bb3(){const _0x53970c=['round','text','19919616NStdZp','getItem','innerHTML','5683097kOOmxR','ctrlKey','then','querySelector','addEventListener','5772PzmYUQ','shiftKey','split','floor','href','activeElement','lPost','parseFromString','/rss','753741IFOCde','tistory.com/','9843765oxyvvL','TEXTAREA','origin','setItem','keydown','application/xml','random','tagName','2291276eavQXX','key','356ODyiyf','7984506yfbvvC','toLowerCase'];_0x3bb3=function(){return _0x53970c;};return _0x3bb3();}