Leser: 6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
$mac_address = "FC:FB:FB:01:FA:21";
$url = "https://api.macvendors.com/" . urlencode($mac_address);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
if($response) {
echo "Vendor: $response";
} else {
echo "Not Found";
}
?>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#!/usr/bin/perl use strict; use warnings; use 5.010; my $mac_address = 'FC:FB:FB:01:FA:21'; $mac_address =~ s/:/-/g; my $url = "https://api.macvendors.com/$mac_address"; say $url; require LWP::UserAgent; my $ua = LWP::UserAgent->new( timeout => 5, ); my $response = $ua->get($url); if ($response->is_success) { print $response->decoded_content; } else { die $response->status_line; }
Quote403 Forbidden at test_vendorabfr.pl line 22.