forked from HTTPArchive/legacy.httparchive.org
-
Notifications
You must be signed in to change notification settings - Fork 1
/
websites.php
95 lines (75 loc) · 2.33 KB
/
websites.php
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
<?php
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
require_once("utils.inc");
require_once("ui.inc");
$gLabel = getParam('l', latestLabel($gArchive));
$gChar = getParam('c', 'A');
$gLcChar = strtolower($gChar);
$gTitle = "Web Sites";
$gMaxUrls = 20000;
?>
<!doctype html>
<html>
<head>
<title><?php echo genTitle($gTitle) ?></title>
<meta charset="UTF-8">
<?php echo headfirst() ?>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<?php echo uiHeader($gTitle); ?>
<form onsubmit="doSubmit(); return false;">
<div style="font-size: 1em;">
<label style="vertical-align: baseline;">Find URL: </label>
<input id="url" style="vertical-align: baseline; margin-left: 1em;" size=40 autocapitalize="off" />
<input type=submit value="Search" style="vertical-align: baseline; margin-left: 1em;">
</div>
</form>
<script>
document.getElementById("url").focus();
</script>
<div id=urls>
</div>
<?php echo uiFooter() ?>
<script>
var inputUrl = document.getElementById("url");
function doSubmit() {
loadScript("findurl.php?term=" + encodeURI(inputUrl.value) + "&jsonp=showResults");
spinnerOn();
}
function showResults(aResults) {
var sHtml = "";
if ( aResults ) {
for ( var i=0, len=aResults.length; i < len; i++ ) {
var hResult = aResults[i];
var url = hResult["label"];
var value = hResult["value"];
if ( 0 == value ) {
// Remaining URLs
sHtml = "<li style='margin-bottom: 1em;'> " + url + "\n" + sHtml;
break;
}
var pageid = hResult["data-pageid"];
sHtml += "<li> <a href='viewsite.php?pageid=" + pageid + "'>" + url + "\n";
}
}
document.getElementById("urls").innerHTML = ( sHtml ?
"<ul style='list-style-type: none;'>\n" + sHtml + "</ul>\n" :
"no results found" );
}
function spinnerOn() {
document.getElementById("urls").innerHTML = "<img src='images/busy.gif'>";
}
</script>
</body>
</html>