Stricter goodie triggers & formatting update
This commit is contained in:
parent
f2b95d44ed
commit
bfc9e53122
@ -3,7 +3,10 @@ package DDG::Goodie::GenerateMAC;
|
|||||||
|
|
||||||
use DDG::Goodie;
|
use DDG::Goodie;
|
||||||
|
|
||||||
triggers startend => "generate mac", "random mac";
|
triggers startend => "generate mac addr",
|
||||||
|
"generate mac address",
|
||||||
|
"random mac addr",
|
||||||
|
"random mac address",;
|
||||||
|
|
||||||
zci answer_type => "MAC Address";
|
zci answer_type => "MAC Address";
|
||||||
zci is_cached => 0;
|
zci is_cached => 0;
|
||||||
@ -13,12 +16,12 @@ description 'generates a MAC address';
|
|||||||
name "GenerateMAC";
|
name "GenerateMAC";
|
||||||
|
|
||||||
attribution github => [ 'https://github.com/UnGround', 'Charlie Belmer' ],
|
attribution github => [ 'https://github.com/UnGround', 'Charlie Belmer' ],
|
||||||
web => ['http://www.charliebelmer.com','Charlie Belmer'];;
|
web => ['http://www.charliebelmer.com','Charlie Belmer'];
|
||||||
|
|
||||||
handle remainder => sub {
|
handle remainder => sub {
|
||||||
my $address = join(':', map {sprintf '%0.2X', rand(255)}(1..6));
|
my $address = join(':', map {sprintf '%0.2X', rand(255)}(1..6));
|
||||||
my $more_info = qq(More information at <a href='http://coffer.com/mac_find/'>coffer.com</a>);
|
my $more_info = qq(More information at <a href='http://coffer.com/mac_find/'>coffer.com</a>);
|
||||||
return $address, html => "Here's a random MAC address: <b>$address</b> <br /> $more_info";
|
return $address, html => "<i>Here's a random MAC address: </i>$address <br /> $more_info";
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
@ -17,12 +17,22 @@ ddg_goodie_test (
|
|||||||
[
|
[
|
||||||
'DDG::Goodie::GenerateMAC'
|
'DDG::Goodie::GenerateMAC'
|
||||||
],
|
],
|
||||||
'generate mac' =>
|
'generate mac address' =>
|
||||||
test_zci(
|
test_zci(
|
||||||
qr/^$mac_regxp$/,
|
qr/^$mac_regxp$/,
|
||||||
html => qr//,
|
html => qr//,
|
||||||
),
|
),
|
||||||
'random mac' =>
|
'generate mac addr' =>
|
||||||
|
test_zci(
|
||||||
|
qr/^$mac_regxp$/,
|
||||||
|
html => qr//,
|
||||||
|
),
|
||||||
|
'random mac address' =>
|
||||||
|
test_zci(
|
||||||
|
qr/^$mac_regxp$/,
|
||||||
|
html => qr//,
|
||||||
|
),
|
||||||
|
'random mac addr' =>
|
||||||
test_zci(
|
test_zci(
|
||||||
qr/^$mac_regxp$/,
|
qr/^$mac_regxp$/,
|
||||||
html => qr//,
|
html => qr//,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user