zeroclickinfo-goodies/lib/DDG/Goodie/GenerateMAC.pm

23 lines
668 B
Perl

package DDG::Goodie::GenerateMAC;
#generates a random network MAC address
use DDG::Goodie;
triggers startend => "generate mac", "random mac";
zci answer_type => "MAC Address";
zci is_cached => 0;
primary_example_queries 'please generate mac';
description 'generates a MAC address';
name "GenerateMAC";
attribution github => [ 'https://github.com/UnGround', 'Charlie Belmer' ];
handle remainder => sub {
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>);
return $address, html => "Here's a random MAC address: <b>$address</b> <br /> $more_info";
};
1;