-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOPML-Converter.html
More file actions
57 lines (57 loc) · 1.73 KB
/
OPML-Converter.html
File metadata and controls
57 lines (57 loc) · 1.73 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>OPML Converter | tools.eliana.lol</title>
<link rel="stylesheet" href="global.css" />
<link rel="icon" type="image/x-icon" href="favicon.svg" />
<style>
.feed-row {
display: grid;
grid-template-columns: 1fr auto;
padding: 10px;
background: var(--hover);
border-bottom: 1px solid var(--puny);
font-size: 0.8rem;
}
.feed-url {
color: var(--puny);
font-size: 0.7rem;
}
</style>
</head>
<body>
<nav>
<div class="left">
<a href="index.html">home</a> | <a href="extra.html">extra</a> |
<a href="credits.html">credits</a> | <a href="changelog.html">logs</a>
</div>
<div class="right">
<button id="theme-toggle">[theme]</button> |
<a href="https://eliana.lol">site</a>
</div>
</nav>
<main>
<h1>OPML to List</h1>
<input type="file" id="fileInput" style="margin: 20px 0" />
<div id="output"></div>
</main>
<script>
document.getElementById('fileInput').onchange = (e) => {
const reader = new FileReader();
reader.onload = (event) => {
const doc = new DOMParser().parseFromString(
event.target.result,
'text/xml'
);
const out = document.getElementById('output');
out.innerHTML = '';
doc.querySelectorAll('outline[xmlUrl]').forEach((el) => {
out.innerHTML += `<div class="feed-row"><div>${el.getAttribute('title')}</div><div class="feed-url">${el.getAttribute('xmlUrl')}</div></div>`;
});
};
reader.readAsText(e.target.files[0]);
};
</script>
</body>
</html>