-
Notifications
You must be signed in to change notification settings - Fork 0
/
schedule.xml
130 lines (110 loc) · 9.33 KB
/
schedule.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Paste CSS above /b:skin
#hari{display:flex;flex-wrap:wrap;margin-bottom:20px;text-align:center;list-style:none;justify-content:space-between;padding:0;border-radius:4px;overflow:hidden;background-color:#1c1c1c}
#hari li{line-height:20px;overflow:hidden;flex-grow:1}
#hari li button{width:100%;padding:10px;color:white}
#hari .text-blue-600{background-color:var(--primary)}
#jadwal .hidden{display:none}
# Paste above </head> if it already exists, skip it
<script defer='defer' type='text/javascript'>/*<![CDATA[*/
"use strict";class BloggerScript{constructor(a={}){this.config=a,this._siteMap={arr:new Array,callback:"undefined",fc:"function",max:150,start:1,url:"url"}}siteMap(b,c=function(a){console.log(a)}){let a=this;a.xhr("GET",`${b}?alt=json-in-script&start-index=${a._siteMap.start}&max-results=${a._siteMap.max}`,function(d){if("entry"in d.feed){let e=d.feed.entry;Array.prototype.push.apply(a._siteMap.arr,a.getFeed(d)),e.length>=a._siteMap.max?(a._siteMap.start+=a._siteMap.max,a.siteMap(b,c)):c(a._siteMap.arr)}else c(a._siteMap.arr)})}getFeed(a){if(a.feed.entry){let b=new Array;return a.feed.entry.forEach(a=>{let c={};c.title=a.title.$t,c.link=this.getLink(a.link),c.image=this.getImage(a),c.label=this.getLabel(a.category),c.date=this.getTime(a.published.$t),c.published=a.published.$t,c.updated=a.updated.$t,"summary"in a&&(c.summary=a.summary.$t),"content"in a&&(c.content=a.content.$t),"author"in a&&(c.author=this.getAuthor(a)),b.push(c)}),b}return[]}getImage(a){if("media$thumbnail"in a)return this.resizeImage(a.media$thumbnail.url);if(!("content"in a))return this.config.noImage||"";{let b=a.content.$t,d=b.indexOf("<img"),c=b.indexOf('src="',d),e=b.indexOf('"',c+5),f=b.substr(c+5,e-c-5);return -1!=d&& -1!=c&& -1!=e&&""!=f?f:this.config.noImage||""}}getAuthor(a){var b,c,d,e,f,g;return{name:(null===(b=a.author[0])|| void 0===b?void 0:null===(c=b.name)|| void 0===c?void 0:c.$t)||"",link:(null===(d=a.author[0])|| void 0===d?void 0:null===(e=d.uri)|| void 0===e?void 0:e.$t)||"",image:(null===(f=a.author[0])|| void 0===f?void 0:null===(g=f.gd$image)|| void 0===g?void 0:g.src)||""}}getLink(a){return a.find(a=>"alternate"==a.rel).href}getLabel(a){return a.map(a=>a.term)}getTime(c){if(/([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))/.test(c)){var b=c,d=b.substring(0,4),e=b.substring(5,7),f=b.substring(8,10),a=new Array;return a[1]="Jan",a[2]="Feb",a[3]="Mar",a[4]="Apr",a[5]="May",a[6]="Jun",a[7]="Jul",a[8]="Aug",a[9]="Sep",a[10]="Oct",a[11]="Nov",a[12]="Dec",f+" "+a[parseInt(e,10)]+" "+d}return!1}resizeImage(a){return this.config.sizeImage?a.match(/\/s[0-9]{2}-(w[0-9]+-)?c/)?a.replace(/\/s[0-9]{2}-(w[0-9]+-)?c/,`/${this.config.sizeImage}`):a.replace(/\=s[0-9]{2}-(w[0-9]+-)?c/,`=${this.config.sizeImage}`):a}relatedPost(b=function(a){console.log(a)}){let a=this,c=0,d=new Array,e=document.location.pathname;"undefined"!=a.config.label&&""!=a.config.label&&0!=a.config.label.length&&a.config.label.forEach(f=>{a.xhr("GET",`/feeds/posts/default/-/${f.replace(/\&/g,"&").replace(/\//g,"%2F")}?alt=json-in-script&max-results=${a.config.jumlah}`,function(g){if("entry"in g.feed&&a.getFeed(g).forEach(a=>{!a.link.includes(e)&&(d.some(b=>b.link==a.link)||d.push(a))}),++c==a.config.label.length){if(0==d.length)return!1;let f=a.shuffle(d);return f.length>a.config.jumlah&&(f=f.slice(0,a.config.jumlah)),b(f)}})})}randomPost(b,c=function(a){console.log(a)}){let a=this,d=a.config.jumlah;a.xhr("GET",`${b}?alt=json-in-script&max-results=0`,function(f){let e=f.feed.openSearch$totalResults.$t;if(a.config.allRandom)e=e<=150?1:a.shuffle2(1,e-150),d=150;else{if(e<a.config.jumlah)return;e=a.shuffle2(1,e-a.config.jumlah)}a.xhr("GET",`${b}?alt=json-in-script&start-index=${e}&max-results=${d}`,function(b){if("entry"in b.feed){let d=a.getFeed(b);return c(d=a.shuffle(d))}})})}shuffle(a){var c,d,b=a.length;if(0===b)return!1;for(;--b;)c=Math.floor(Math.random()*(b+1)),d=a[b],a[b]=a[c],a[c]=d;return a}shuffle2(a,b){return Math.floor(Math.random()*(b-a))+a}xhr(b,c,d){let a=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");a.onreadystatechange=function(){if(4==this.readyState&&200==this.status||304==this.status){let a=this.responseText,b=JSON.parse(a.substring(a.indexOf("{"),a.lastIndexOf("}")+1));d&&d(b)}},a.onerror=a=>console.log(a),a.open(b,c,!0),a.send()}inTag(b){let a=document.createElement("script");a.src=b,document.body.appendChild(a)}}
/*]]>*/</script>
# Paste above </body>
<script defer='defer' src='https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.4/flowbite.min.js'/>
# Paste this script inside b:section:
<b:widget cond='data:view.isHomepage' id='HTML51' locked='true' title='Schedule' type='HTML' version='2' visible='true'>
<b:widget-settings>
<b:widget-setting name='content'>Jadwal</b:widget-setting>
</b:widget-settings>
<b:includable id='main'>
<div class='flex items-center justify-between wrap mb-4'><h2 class='title'><data:title/></h2><time class='rounded-full bg-white text-neutral-900 px-2 py-1 font-bold' id='time'/></div>
<section id='jadwalRilis'/>
<script defer='defer'>
/*<![CDATA[*/
let jadwalRilisRun = new BloggerScript({
noImage: 'https://1.bp.blogspot.com/-XSp30PahyTM/YK37Rq_-M7I/AAAAAAAABCc/01K0sUhw-2YI7vr48wqMIAVoMLDEUdK2gCLcBGAsYHQ/s0/No%2BImage%2BBerkas%2BKita.jpg',
sizeImage: 's370-rw'
});
(function () {
const customFormat = (date) => {
let hours = date.getHours();
let minutes = date.getMinutes();
hours = hours % 12;
hours = hours ? hours : 12;
minutes = minutes < 10 ? '0' + minutes : minutes;
const amPm = hours >= 12 ? 'PM' : 'AM';
const timeString = hours + ':' + minutes + ' ' + amPm;
return timeString;
};
let a = document,
b = window,
jadwalRilis = a.getElementById('jadwalRilis'),
days = ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'],
day = new Date().getDay(),
sortedDays = days.slice(day).concat(days.slice(0, day));
if (!jadwalRilis) {
return;
}
let html = `<div class='days'><ul class='flex flex-wrap -mb-px text-sm font-medium text-center justify-evenly' id='hari' data-tabs-toggle='#jadwal' role='tablist'>`,
html2 = `<div id='jadwal' class='items'>`;
sortedDays.forEach((item, index) => {
let valu = item.toLowerCase();
let check = index == 0 ? 'true' : 'false';
html += `<li class='overflow-hidden grow leading-9' role='presentation'><button class='bg-white shadow dark:bg-neutral-800 inline-block w-full py-2.5 px-1.5 aria-selected:text-neutral-900 aria-selected:dark:text-neutral-900' id='${valu}-tab' data-tabs-target='#${valu}' type='button' role='tab' aria-controls='${valu}' aria-selected='${check}'>${item}</button></li>`;
html2 += `<div class='timeline hidden' id='${valu}' role='tabpanel' aria-labelledby='${valu}-tab'></div>`;
});
jadwalRilis.innerHTML = `${html}</ul></div>${html2}</div>`;
sortedDays.forEach((item, index) => {
let valu = item.toLowerCase();
a.getElementById(`${valu}-tab`).addEventListener('click', (e) => {
currentTar = e.currentTarget;
if (currentTar.classList.contains('itemExist')) {
return;
}
currentTar.classList.add('itemExist');
a.getElementById(valu).innerHTML = '<p>Loading...</p>';
/*
Catatan
url: https://www.blogger.com/feeds/9023265581606716045
bisa di ganti dengan
url: https://anime-la-bt.blogspot.com/feeds
*/
jadwalRilisRun.xhr('GET', `/feeds/9023265581606716045/posts/default/-/${item.replace(/\&/g,"&").replace(/\//g,"%2F")}?alt=json-in-script&max-results=150`, (e) => {
if ('entry' in e.feed) {
let feeds = jadwalRilisRun.getFeed(e),
html = ``;
feeds.forEach(item => {
let epsName = item.label.find(i => i.match(/^Ep\s[0-9]{1}/gm)) || 'N/A',
tipeName = item.label.find(i => ['TV', 'Movie', 'OVA', 'ONA'].includes(i)) || 'N/A',
timeName = customFormat(new Date(item.updated)),
timeNamev2 = item.label.find(i => i.match(/[0-9]{2}:[0-9]{2}/)) || timeName;
html += `<div class='item'><a href="${item.link}"><time>${timeNamev2}</time>
<img src="${item.image}" alt="${item.title}" />
</a><div class='info'><a href='${item.link}' class='name' title='${item.title}'>`;
if (tipeName == 'Movie') {
html += `<span class='tipe movie'>${tipeName}</span>`;
} else if (tipeName == 'OVA') {
html += `<span class='tipe ova'>${tipeName}</span>`;
} else if (tipeName == 'ONA') {
html += `<span class='tipe ona'>${tipeName}</span>`;
} else {
html += `<span class='tipe other'>${tipeName}</span>`;
}
html += `${item.title}</a></div><div class='na'><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="currentColor" d="M7.571 11.84C6.908 12.298 6 11.827 6 11.024V4.975c0-.803.908-1.274 1.571-.816l3.784 2.617a1.486 1.486 0 0 1 0 2.447L7.571 11.84Z"/></svg>${epsName}</div></div>`;
});
a.getElementById(valu).innerHTML = html;
} else {
a.getElementById(valu).innerHTML = '<p>Nothing Post</p>';
}
})
});
if (index == 0) {
a.getElementById(`${valu}-tab`).click();
}
});
})();
/*]]>*/
</script>
<script defer='defer'>var d = new Date();
document.getElementById("time").innerHTML = d;</script>
</b:includable>
</b:widget>