forked from HTTPArchive/legacy.httparchive.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.php
93 lines (75 loc) · 2.66 KB
/
urls.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
<?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("ui.inc");
require_once("utils.inc");
$gTitle = "URLs";
?>
<!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" />
<style>
DT { font-weight: bold; margin-top: 20px; }
DD { margin-left: 40px; }
</style>
</head>
<body>
<?php echo uiHeader($gTitle); ?>
<h1><?php echo $gTitle ?></h1>
<p>
Use the form below to generate a list of the URLs used during the most recent HTTP Archive crawl.
The URLs are sorted based on the ranking from the <a href="http://www.alexa.com/topsites">Alexa Top 1,000,000 Sites</a>.
</p>
<?php
$gStart = getParam("start", 1);
if ( $gStart < 1 ) {
$gStart = 1;
}
$gEnd = getParam("end", 10);
$gMax = 10000;
if ( $gEnd > $gMax ) {
$gEnd = $gMax;
}
$gbNums = getParam("nums", 0);
?>
<style>
TABLE { border-bottom: 0; }
TR { vertical-align: middle; }
TD { padding: 0 0.5em 0.5em 0; border-bottom: 0; vertical-align: middle; }
INPUT { padding: 0; margin: 0; }
</style>
<table cellpadding=0 cellspacing=0 border=0 style="width: auto;">
<form action="">
<tr> <td style="text-align: right;">start:</td> <td><input type=text size=7 id=start name=start value="<?php echo $gStart ?>" style="text-align: right;"></td> </tr>
<tr> <td style="text-align: right;">end:</td> <td><input type=text size=7 id=end name=end value="<?php echo $gEnd ?>" style="text-align: right;"> <span style="font-size: 0.9em;">(capped at 10,000)</span></td> </tr>
<tr> <td colspan=2><input type=checkbox id=nums name=nums<?php echo ($gbNums ? " checked" : "") ?>> include numbers</td> </tr>
<tr> <td colspan=2><input type=submit value="Generate List"></td> </tr>
</form>
</table>
<pre style="margin-top: 2em;">
<?php
$query = "select rank, urlOrig, urlFixed from $gUrlsTable where rank >= $gStart and rank <= $gEnd order by rank asc;";
$result = doQuery($query);
while ($row = mysqli_fetch_assoc($result)) {
$url = ( $row['urlFixed'] ? $row['urlFixed'] : $row['urlOrig'] );
echo ( $gbNums ? $row['rank'] . "," : "" ) . "<a href='$url'>$url</a>\n";
}
mysqli_free_result($result);
?>
</pre>
<?php echo uiFooter() ?>
</body>
</html>