-
-
Notifications
You must be signed in to change notification settings - Fork 369
/
fetch-issue-cnt.php
39 lines (34 loc) · 716 Bytes
/
fetch-issue-cnt.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
<html>
<p align="right">
<?php
# Format is as follows:
#"Severity","Number of issues"
#"regression",32
#"blocker",16
#"critical",53
#"major",160
#"normal",1531
#"minor",101
#"trivial",17
#"enhancement",707
$url = 'https://issues.dlang.org/report.cgi?' . $_SERVER["QUERY_STRING"];
$data = file_get_contents($url);
$lines = explode("\n", $data);
unset($lines[0]);
$result = 0;
foreach ($lines as $line)
{
$kv = explode(",", $line);
$result += $kv[1];
}
echo $result;
#$url = 'https://issues.dlang.org/buglist.cgi?' . $_SERVER["QUERY_STRING"];
#echo $url;
#$data = file_get_contents($url);
#$regex = '/(\d+) issues found/';
#preg_match($regex,$data,$match);
#var_dump($match);
#echo $match[1];
?>
</p>
</html>