-
Notifications
You must be signed in to change notification settings - Fork 0
/
url-extract.html
93 lines (88 loc) · 2.97 KB
/
url-extract.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
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>URL Extract</title>
<meta name="description" content="URL Extract">
<meta name="author" content="Blazz3">
<link rel="stylesheet" href="">
<link href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAABEREAABEQAAEREQAAAREAAAAAAAAAERAAAAAAAAABEQAAAAAAABEQAAAAAAABEQAAAAAAABEQAAAAAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" rel="icon" type="image/x-icon" />
<script>
function url_extract(text) {
// https://gist.github.com/dperini/729294
var urlRegex = new RegExp(
// protocol identifier
"(?:(?:https?|ftp)://)" +
// user:pass authentication
"(?:\\S+(?::\\S*)?@)?" +
"(?:" +
// IP address exclusion
// private & local networks
"(?!(?:10|127)(?:\\.\\d{1,3}){3})" +
"(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})" +
"(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})" +
// IP address dotted notation octets
// excludes loopback network 0.0.0.0
// excludes reserved space >= 224.0.0.0
// excludes network & broacast addresses
// (first & last IP address of each class)
"(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" +
"(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" +
"(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" + "|" +
// host name
"(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)" +
// domain name
"(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*" +
// TLD identifier
"(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))" +
// TLD may end with dot
"\\.?" +
")" +
// port number
"(?::\\d{2,5})?" +
// resource path
"(?:[/?#]\\S*)?",
"gi"
);
var matches = text.match(urlRegex);
var ret = '';
if (matches) {
for (var i = 0; i < matches.length; i++) {
ret += matches[i];
ret += "\n";
window.open(matches[i]);
}
}
document.getElementById('textar').value = '';
document.getElementById('textar').value = ret;
//return ret;
}
</script>
<style>
.center {
margin: auto;
width: 60%;
border: 1px solid white;
padding: 10px;
}
.textar {
width:100%;
display:block;
max-width:100%;
}
.bt {
width:100%;
display:block;
max-width:100%;
}
</style>
</head>
<body style="background-color: black;">
<h2 style="text-align: center; color: white;">URL Extract</h2>
<div class="center">
<textarea class="textar" id="textar" rows="15"></textarea>
</div>
<div class="center">
<input class="bt" type="submit" value="Extract Links!" onclick="url_extract(document.getElementById('textar').value);">
</div>
</body>
</html>