23 |
BufferedReader in = new BufferedReader( new InputStreamReader(input) ); |
BufferedReader in = new BufferedReader( new InputStreamReader(input) ); |
24 |
|
|
25 |
Map<String,Integer> versions = new TreeMap<String,Integer>(); |
Map<String,Integer> versions = new TreeMap<String,Integer>(); |
26 |
|
Map<String,Integer> phones = new TreeMap<String,Integer>(); |
27 |
|
|
28 |
String line; |
String line; |
29 |
while ( (line=in.readLine()) != null) { |
while ( (line=in.readLine()) != null) { |
30 |
if (line.indexOf("traininfo/version") == -1) |
if (line.indexOf("traininfo/version") == -1) |
31 |
continue; |
continue; |
32 |
String version = ""; |
String version = ""; |
33 |
|
String phone = ""; |
34 |
String parts[] = line.split(" "); |
String parts[] = line.split(" "); |
35 |
|
|
36 |
if (parts.length >= 8) { |
if (parts.length >= 8) { |
37 |
String uri = parts[7]; |
String uri = parts[7]; |
38 |
String tmpVer = HttpUtil.decodeUri(uri).get("version"); |
Map<String,String> params = HttpUtil.decodeUri(uri); |
39 |
|
String tmpVer = params.get("version"); |
40 |
|
|
41 |
if (tmpVer != null) |
if (tmpVer != null) |
42 |
version = tmpVer; |
version = tmpVer; |
43 |
|
|
44 |
|
String tmpPhone = params.get("phone"); |
45 |
|
String tmpAndroid = params.get("android"); |
46 |
|
if (tmpPhone != null && tmpAndroid != null) |
47 |
|
phone = tmpPhone + " " + tmpAndroid; |
48 |
} |
} |
49 |
|
|
50 |
Integer count = versions.get(version); |
Integer count = versions.get(version); |
51 |
if (count == null) |
if (count == null) |
52 |
count = 0; |
count = 0; |
53 |
versions.put(version, count+1); |
versions.put(version, count+1); |
54 |
|
|
55 |
|
count = phones.get(phone); |
56 |
|
if (count == null) |
57 |
|
count = 0; |
58 |
|
phones.put(phone, count+1); |
59 |
|
|
60 |
} |
} |
61 |
|
|
78 |
%> |
%> |
79 |
</table> |
</table> |
80 |
|
|
81 |
|
<h2>Phones / Android ver.</h2> |
82 |
|
<table border='0'> |
83 |
|
<% |
84 |
|
for (String key : phones.keySet()) { |
85 |
|
int val = phones.get(key); |
86 |
|
%> |
87 |
|
<tr><td><%=key%></td><td align='right'><%= val %></td></tr> |
88 |
|
<% |
89 |
|
} |
90 |
|
%> |
91 |
|
</table> |
92 |
</body> |
</body> |
93 |
</html> |
</html> |
94 |
|
|