diff --git a/lib/DDG/Goodie/PrivateNetwork.pm b/lib/DDG/Goodie/PrivateNetwork.pm index 6fcff0914..3ae8f11ea 100644 --- a/lib/DDG/Goodie/PrivateNetwork.pm +++ b/lib/DDG/Goodie/PrivateNetwork.pm @@ -19,9 +19,15 @@ attribution twitter => 'crazedpsyc', my $text = scalar share('private_network.txt')->slurp, my $html = scalar share('private_network.html')->slurp; +my $css = scalar share('style.css')->slurp; +sub append_css { + my $html = shift; + return "$html"; +} + handle sub { - $text, html => $html; + $text, html => append_css($html) }; 1; diff --git a/share/goodie/private_network/private_network.html b/share/goodie/private_network/private_network.html index d77aa0a0a..0655c0d96 100644 --- a/share/goodie/private_network/private_network.html +++ b/share/goodie/private_network/private_network.html @@ -1,17 +1,41 @@ -Private network IP addresses: -
IPv4 addresses (rfc1918): -
10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 -
172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 -
192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 -
-
Carrier NAT (rfc6598): -
100.64.0.0 - 100.127.255.255 | 100.64.0.0/10 -
-
Test Networks (rfc5735): -
TEST-NET-1: 192.0.2.0 - 192.0.2.255 | 192.0.2.0/24 -
TEST-NET-2: 198.51.100.0 - 198.51.100.255 | 198.51.100.0/24 -
TEST-NET-3: 203.0.113.0 - 203.0.113.255 | 203.0.113.0/24 -
Benchmarks: 198.18.0.1 - 198.19.255.255 | 198.18.0.0/15 -
-
Private network IPv6 addresses (rfc4193): -
Unique local addresses: fd00::/8 +
+ + + + + + + + + + + + + + + + + +
+

IPv4 addresses (rfc1918):

+
+

10.0.0.0 - 10.255.255.255 | 10.0.0.0/8

+

172.16.0.0 - 172.31.255.255 | 172.16.0.0/12

+

192.168.0.0 - 192.168.255.255 | 192.168.0.0/16

+
+

Carrier NAT (rfc6598):

+
+

100.64.0.0 - 100.127.255.255 | 100.64.0.0/10

+
+

Test Networks (rfc5735):

+
+

TEST-NET-1: 192.0.2.0 - 192.0.2.255 | 192.0.2.0/24

+

TEST-NET-2: 198.51.100.0 - 198.51.100.255 | 198.51.100.0/24

+

TEST-NET-3: 203.0.113.0 - 203.0.113.255 | 203.0.113.0/24

+

Benchmarks: 198.18.0.1 - 198.19.255.255 | 198.18.0.0/15

+
+

IPv6 addresses (rfc4193):

+
+

Unique local addresses: fd00::/8

+
+
\ No newline at end of file diff --git a/share/goodie/private_network/style.css b/share/goodie/private_network/style.css new file mode 100755 index 000000000..e9bc3e6e8 --- /dev/null +++ b/share/goodie/private_network/style.css @@ -0,0 +1,11 @@ +.zci--answer .private_network .record__cell__key { + padding: 0.4em; +} + +.zci--answer .private_network .record__cell__value { + padding: 0.4em; +} + +.zci--answer .private_network p { + padding: 0; +} \ No newline at end of file diff --git a/t/PrivateNetwork.t b/t/PrivateNetwork.t index 368cc1e2a..bc079cbbb 100644 --- a/t/PrivateNetwork.t +++ b/t/PrivateNetwork.t @@ -9,11 +9,11 @@ zci answer_type => 'private_network'; zci is_cached => 1; ddg_goodie_test( - [qw( - DDG::Goodie::PrivateNetwork - )], - map { ("$_" => test_zci( - 'Private network IPv4 addresses (rfc1918): + [qw( + DDG::Goodie::PrivateNetwork + )], + map { ("$_" => test_zci( + 'Private network IPv4 addresses (rfc1918): 10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 @@ -30,24 +30,7 @@ Benchmarks: 198.18.0.1 - 198.19.255.255 | 198.18.0.0/15 Private network IPv6 addresses (rfc4193): Unique local addresses: fd00::/8 ', - html => 'Private network IP addresses: -
IPv4 addresses (rfc1918): -
10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 -
172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 -
192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 -
-
Carrier NAT (rfc6598): -
100.64.0.0 - 100.127.255.255 | 100.64.0.0/10 -
-
Test Networks (rfc5735): -
TEST-NET-1: 192.0.2.0 - 192.0.2.255 | 192.0.2.0/24 -
TEST-NET-2: 198.51.100.0 - 198.51.100.255 | 198.51.100.0/24 -
TEST-NET-3: 203.0.113.0 - 203.0.113.255 | 203.0.113.0/24 -
Benchmarks: 198.18.0.1 - 198.19.255.255 | 198.18.0.0/15 -
-
Private network IPv6 addresses (rfc4193): -
Unique local addresses: fd00::/8 -' + html => qr#.*# )) } ( 'private network', 'private networks', 'private ips' ) );