-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgetStaleSites.php
56 lines (54 loc) · 1.48 KB
/
getStaleSites.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
<?php
include_once 'SiteScanner.class.php';
include_once 'config.php';
if($basePath !== null) {
try {
$ss = new SiteScanner($basePath, $ignoredSites, $ignoredFileNames);
$ss->scanSites();
//$ss->displayReport($basePath); //Bug https://github.com/BinghamtonUniversity/stale-sites/issues/10
$ans = $ss->getReport();
asort($ans);
$intervals = array(
"24+ Months Old" => 730,
"18+ Months Old" => 545,
"12+ Months Old" => 365,
"6+ Months Old" => 180,
"3+ Months Old" => 90
);
?>
<table class="table table-striped table-hover table-bordered">
<tr>
<td width="10%"><strong>Exclude</strong></td>
<td width="80%"><strong>Name</strong></td>
<td width="10%"><strong>Days</strong></td>
</tr>
<?php
foreach ($intervals as $interval_key => $interval_value) {
$started = false;
foreach ($ans as $key => $value) {
if(intval($value) > $interval_value) {
if(!$started) { $started = true;
?>
<tr>
<td colspan="3" style="text-align:center;"><?=$interval_key?></td>
</tr>
<?php } ?>
<tr>
<td><a class="icon-remove" href="addExcludeUrls.php?url=<?=urlencode($key)?>"></a></td>
<td><a href="<?="http://".$_SERVER['HTTP_HOST'].'/'.$key?>"><?=$key?></a></td>
<td><?=$value?></td>
</tr>
<?php
unset($ans[$key]);
}
}
}
?>
</table>
<?php
}
catch(Exception $e) {
echo $e->getMessage();
}
}
?>