-
Notifications
You must be signed in to change notification settings - Fork 7
/
domain-extractor.html
145 lines (125 loc) · 4.61 KB
/
domain-extractor.html
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!-- https://abay.kustirama.id/domain-extractor -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Domain Extractor | kustirama.id</title>
<link rel="shortcut icon" href="https://akbar.kustirama.id/icon.svg" />
<meta name="description" content="Simple Metronome" />
<meta name="keywords" content="abay,akbar,abaykan,mukhammad akbar,codelatte" />
<meta name="author" content="kustirama.id" />
<meta property="og:title" content="akbar | kustirama.id" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="akbar | kustirama.id" />
<meta property="og:description" content="Simple Metronome" />
<meta property="og:url" content="https://akbar.kustirama.id" />
<meta property="og:image:alt" content="akbar | kustirama.id" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@abaykandotcom" />
<meta name="twitter:creator" content="@abaykandotcom" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css" />
<style>
BODY {
font: 16px/1.4 "Trebuchet MS", Arial, sans-serif;
color: #000;
}
A {
color: steelblue;
}
H1 {
font: 2em/1.4 Georgia, serif;
text-align: center;
}
P {
margin: 1.2rem 0;
}
TEXTAREA {
width: 100%;
height: 150px;
margin: 0;
padding: 5px;
border: 1px solid #ccc;
border-radius: 10px;
font-size: 13px;
font-family: monospace;
}
.wrapper {
width: 650px;
margin: 1.5rem auto 4rem;
}
.header {
position: relative;
margin-bottom: 2rem;
padding-bottom: 1rem;
border-bottom: 1px solid #ccc;
}
.header:before {
content: "";
display: table;
width: 100%;
clear: both;
}
.footer {
position: absolute;
bottom: 10px;
display: flex;
justify-content: space-between;
margin-top: 3rem;
padding-top: 2rem;
border-top: 1px solid #ccc;
}
.containers {
margin-bottom: 32px;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.container {
position: relative;
width: 100%;
margin-bottom: 1em;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
</style>
</head>
<body translate="no">
<div class="wrapper">
<header class="header">
<h1>Domain Extractor</h1>
</header>
<main>
<div class="containers">
<div class="container container--left">
<h4>URL List:</h4>
<textarea id="list" spellcheck="false"></textarea>
</div>
<button onclick="return extract()">Extract</button>
<div class="container container--right container container--result" style="margin-top: 50px;">
<h4>Extracted Domain:</h4>
<textarea id="result" spellcheck="false"></textarea>
</div>
</div>
</main>
<footer class="footer">
<a href="https://twitter.com/kustirama">@kustirama</a>
</footer>
<script>
function getDomain(url) {
var match = url.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);
if ( match != null && match.length > 2 && typeof match[2] === 'string' && match[2].length > 0 ) return match[2];
}
function extract() {
let listbaru = "";
var list = document.getElementById('list').value.split('\n');
for(var i = 0;i < list.length;i++){
listbaru += getDomain(list[i]) + "\n"
console.log(getDomain(list[i]))
}
document.getElementById('result').value = listbaru;
}
</script>
</div>
</body>
</html>