Permalink
Browse files

Merge branch 'master' of github.com:duckduckgo/zeroclickinfo-goodies

  • Loading branch information...
2 parents 2ec11d5 + 1e0a108 commit 525d661ef49a9754818e7a7c29d15ff935280236 @majuscule majuscule committed Jul 12, 2012
Showing with 21 additions and 21 deletions.
  1. +3 −3 lib/DDG/Goodie/IDN.pm
  2. +16 −16 share/goodie/private_network/private_network.html
  3. +2 −2 t/ParseCron.t
View
@@ -13,9 +13,9 @@ attribution web => ['http://7bits.nl/', 'Peter van Dijk'],
triggers startend => 'idn', 'international domain', 'internationalized domain';
handle query_lc => sub {
- return unless s/(international(?:ized)? domain(?: name)?|idn)//;
- my $idn = ($1 eq "idn" ? uc $1 : $1) . ":";
- return unless m/\.(?:ac|ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|asia|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cat|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|info|int|io|iq|ir|is|it|je|jm|jo|jobs|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|local|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mo|mobi|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|travel|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xxx|ye|yt|za|zm|zw)/i;
+ return unless s/(international(?:ized)? domain(?: name)?|idn) //;
+ my $idn = ($1 eq "idn" ? uc $1 : $1) . ": ";
+ return unless m/\.(ac|ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|asia|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cat|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|info|int|io|iq|ir|is|it|je|jm|jo|jobs|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|local|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mo|mobi|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|travel|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xxx|ye|yt|za|zm|zw)$/i;
if(/^xn--/) {
return 'Decoded ' . $idn . encode_entities(domain_to_unicode($_));
}
@@ -1,17 +1,17 @@
Private network IP addresses:
-IPv4 addresses (<a href="http://www.rfc-editor.com/rfc/rfc1918">rfc1918</a>):
-Class A: 10. 0.0.0 - 10.255.255.255 | 10. 0.0.0/8
-Class B: 172.16.0.0 - 172. 31.255.255 | 172. 16.0.0/12
-Class C: 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16
-
-Carrier NAT (<a href="http://www.rfc-editor.com/rfc/rfc6598.txt">rfc6598</a>):
-100.64.0.0 - 100.127.255.255/10 | 100.64.0.0/10
-
-Test Networks (<a href="http://www.rfc-editor.org/rfc/rfc5735.txt">rfc5735</a>):
-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 (<a href="http://www.rfc-editor.com/rfc/rfc4193.txt">rfc4193</a>):
-Unique local addresses: fd00::/8
+<br>IPv4 addresses (<a href="http://www.rfc-editor.com/rfc/rfc1918">rfc1918</a>):
+<br>Class A: 10. 0.0.0 - 10.255.255.255 | 10. 0.0.0/8
+<br>Class B: 172.16.0.0 - 172. 31.255.255 | 172. 16.0.0/12
+<br>Class C: 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16
+<br>
+<br>Carrier NAT (<a href="http://www.rfc-editor.com/rfc/rfc6598.txt">rfc6598</a>):
+<br>100.64.0.0 - 100.127.255.255/10 | 100.64.0.0/10
+<br>
+<br>Test Networks (<a href="http://www.rfc-editor.org/rfc/rfc5735.txt">rfc5735</a>):
+<br>TEST-NET-1: 192.0.2.0 - 192.0.2.255 | 192.0.2.0/24
+<br>TEST-NET-2: 198.51.100.0 - 198.51.100.255 | 198.51.100.0/24
+<br>TEST-NET-3: 203.0.113.0 - 203.0.113.255 | 203.0.113.0/24
+<br>Benchmarks: 198.18.0.1 - 198.19.255.255 | 198.18.0.0/15
+<br>
+<br>Private network IPv6 addresses (<a href="http://www.rfc-editor.com/rfc/rfc4193.txt">rfc4193</a>):
+<br>Unique local addresses: fd00::/8
View
@@ -12,8 +12,8 @@ ddg_goodie_test(
[qw(
DDG::Goodie::ParseCron
)],
- 'crontab * */3 * * *' => test_zci(qr/^Cron will schedule the job at this frequency: \n\d{2}:\d{2}:\d{2} on \d{1,2} [a-zA-Z]{3}, \d{4}\n\d{2}:\d{2}:\d{2} on \d{1,2} [a-zA-Z]{3}, \d{4}\n\d{2}:\d{2}:\d{2} on \d{1,2} [a-zA-Z]{3}, \d{4}$/),
- 'crontab 42 12 3 Feb Sat' => test_zci(qr/^Cron will schedule the job at this frequency: \n\d{2}:\d{2}:\d{2} on \d{1,2} [a-zA-Z]{3}, \d{4}\n\d{2}:\d{2}:\d{2} on \d{1,2} [a-zA-Z]{3}, \d{4}\n\d{2}:\d{2}:\d{2} on \d{1,2} [a-zA-Z]{3}, \d{4}$/),
+ 'crontab * */3 * * *' => test_zci(qr/^Cron will schedule the job at this frequency:\s*\n\s*\d{1,2}:\d{1,2}:\d{1,2} on \d{1,2} [a-zA-Z]{3}, \d{4}\s*\n\s*\d{1,2}:\d{1,2}:\d{1,2} on \d{1,2} [a-zA-Z]{3}, \d{4}\s*\n\s*\d{1,2}:\d{1,2}:\d{1,2} on \d{1,2} [a-zA-Z]{3}, \d{4}$/),
+ 'crontab 42 12 3 Feb Sat' => test_zci(qr/^Cron will schedule the job at this frequency:\s*\n\s*\d{1,2}:\d{1,2}:\d{1,2} on \d{1,2} [a-zA-Z]{3}, \d{4}\s*\n\s*\d{1,2}:\d{1,2}:\d{1,2} on \d{1,2} [a-zA-Z]{3}, \d{4}\s*\n\s*\d{1,2}:\d{1,2}:\d{1,2} on \d{1,2} [a-zA-Z]{3}, \d{4}$/),
);
done_testing;

0 comments on commit 525d661

Please sign in to comment.