+add script version like-unlike
version v1.2
Show Code
//buat menampilkan jumlah likes, bisa diletakan dihomepage
<span class='datalike' expr:data-id='data:post.id' data-web='hirulikes'/>
//button likes, letakan ditempat tempat post
<button class='button_likes_hiru' expr:data-id='data:post.id' expr:data-image='data:post.featuredImage' expr:data-title='data:post.title' expr:data-url='data:post.url' data-web='hirulikes' type='button'>
<span class='likes_ditampilkan_hiru likeCount'>
</span></button>
button.button_likes_hiru {
padding: 2px 10px;
background: #24292f;
color: #fff;
border-radius: 15px;
width: max-content;
display: inline-flex;
text-align: center;
align-items: center;
justify-content: center;
gap: 5px;
border: none;
margin:5px 0;
}
button.button_likes_hiru::before {
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 48 48'%3E%3Cpath fill='%23f44336' d='M34 9c-4.2 0-7.9 2.1-10 5.4C21.9 11.1 18.2 9 14 9C7.4 9 2 14.4 2 21c0 11.9 22 24 24 24s22-12 22-24c0-6.6-5.4-12-12-12'/%3E%3C/svg%3E");
}
<script src='https://www.gstatic.com/firebasejs/8.6.8/firebase-app.js'/>
<script src='https://www.gstatic.com/firebasejs/8.6.8/firebase-database.js'/>
<script>/*<![CDATA[*/
//harap ganti url databasenya
const buttonLikedb = {
databaseURL: "https://hiru-af04f-default-rtdb.firebaseio.com",
};
firebase.initializeApp(buttonLikedb);
const db_hiru = firebase.database();
const Credit_hirutshuji = "Hirutshuji";
const nilaiLike = 1;
function _0x1505(_0x3c9748,_0x2f5744){const _0x2704ad=_0x2704();return _0x1505=function(_0x150586,_0x307244){_0x150586=_0x150586-0xc7;let _0x5aa661=_0x2704ad[_0x150586];return _0x5aa661;},_0x1505(_0x3c9748,_0x2f5744);}const _0x2d81c5=_0x1505;(function(_0x41c383,_0x20d31c){const _0x442b1a=_0x1505,_0x31c52d=_0x41c383();while(!![]){try{const _0x14b3c2=-parseInt(_0x442b1a(0xd1))/0x1+-parseInt(_0x442b1a(0xcc))/0x2+parseInt(_0x442b1a(0xcb))/0x3+-parseInt(_0x442b1a(0xd0))/0x4*(-parseInt(_0x442b1a(0xd4))/0x5)+-parseInt(_0x442b1a(0xca))/0x6*(-parseInt(_0x442b1a(0xd3))/0x7)+parseInt(_0x442b1a(0xc7))/0x8+-parseInt(_0x442b1a(0xce))/0x9*(-parseInt(_0x442b1a(0xc8))/0xa);if(_0x14b3c2===_0x20d31c)break;else _0x31c52d['push'](_0x31c52d['shift']());}catch(_0x4ca259){_0x31c52d['push'](_0x31c52d['shift']());}}}(_0x2704,0x992b8));if(db_hiru){const scriptXLike=document[_0x2d81c5(0xd2)](_0x2d81c5(0xc9));scriptXLike[_0x2d81c5(0xcd)]=_0x2d81c5(0xcf),document['body']['appendChild'](scriptXLike);}function _0x2704(){const _0xd5e382=['114MJSWjq','282288sKguFS','1464580nfKqtz','src','9CFCucz','https://cdn.jsdelivr.net/gh/MagicReincarnation/hosting-js-hirutshuji@main/buttonLike-v1-0.js','1437088mUinEW','996468pLeDav','createElement','182609eRXClF','10IJcAXS','5974296zxHRGn','3010620gVpKnz','script'];_0x2704=function(){return _0xd5e382;};return _0x2704();}
(function(_0x5a00fb,_0x5909b1){const _0x57c420=_0x4631,_0x3380f0=_0x5a00fb();while(!![]){try{const _0x2d88fe=parseInt(_0x57c420(0x195))/0x1+-parseInt(_0x57c420(0x196))/0x2*(-parseInt(_0x57c420(0x18f))/0x3)+-parseInt(_0x57c420(0x190))/0x4*(parseInt(_0x57c420(0x188))/0x5)+parseInt(_0x57c420(0x193))/0x6*(parseInt(_0x57c420(0x18b))/0x7)+-parseInt(_0x57c420(0x187))/0x8*(parseInt(_0x57c420(0x18d))/0x9)+parseInt(_0x57c420(0x186))/0xa+-parseInt(_0x57c420(0x194))/0xb;if(_0x2d88fe===_0x5909b1)break;else _0x3380f0['push'](_0x3380f0['shift']());}catch(_0x4c314b){_0x3380f0['push'](_0x3380f0['shift']());}}}(_0x30ab,0xb651b));const ambilDatalike=document['querySelectorAll']('.datalike');function _0x4631(_0x4c1347,_0x33c57c){const _0x30abaf=_0x30ab();return _0x4631=function(_0x463143,_0x5e34b0){_0x463143=_0x463143-0x183;let _0xa74fec=_0x30abaf[_0x463143];return _0xa74fec;},_0x4631(_0x4c1347,_0x33c57c);}ambilDatalike['forEach'](function(_0x14a2fc){const _0x4595bc=_0x4631,_0x34beb2=_0x14a2fc[_0x4595bc(0x183)](_0x4595bc(0x184)),_0x492ca1=_0x14a2fc['getAttribute'](_0x4595bc(0x18c));db_hiru[_0x4595bc(0x191)](_0x4595bc(0x18a)+_0x492ca1+'/'+_0x34beb2)['once'](_0x4595bc(0x189))[_0x4595bc(0x185)](_0x481d73=>{const _0x2651e8=_0x4595bc,_0x2490d5=_0x481d73[_0x2651e8(0x18e)]();let _0x263e15=0x0;_0x2490d5&&(_0x263e15=_0x2490d5['like']||0x0),_0x14a2fc[_0x2651e8(0x192)]=nsft(_0x263e15);})['catch'](_0x159d2f=>{console['error']('Error\x20mengambil\x20data\x20likes:',_0x159d2f);});});function _0x30ab(){const _0x16dad3=['991939eHMkFe','2211206KAmQcU','getAttribute','data-id','then','4699600fNLqax','16ARDfLZ','50ePxiMr','value','/likes_hiru/','28mvUfMD','data-web','3343149QYeqrm','val','3pjZpom','552616VImQrs','ref','textContent','820308RxPqQK','2674463QIVmhC'];_0x30ab=function(){return _0x16dad3;};return _0x30ab();}
/*]]>*/</script>