How to resolve the algorithm MAC vendor lookup step by step in the AppleScript programming language
How to resolve the algorithm MAC vendor lookup step by step in the AppleScript programming language
Table of Contents
Problem Statement
Every connected device around the world comes with a unique Media Access Control address, or a MAC address. A common task a network administrator may come across is being able to identify a network device's manufacturer when given only a MAC address.
Interface with one (or numerous) APIs that exist on the internet and retrieve the device manufacturer based on a supplied MAC address. A MAC address that does not return a valid result should return the String "N/A". An error related to the network connectivity or the API should return a null result. Many implementations on this page use http://api.macvendors.com/ which, as of 19th September 2021, is throttling requests. After only 2 calls, the following response is returned for all subsequent requests. If you are planning to use the same provider or going to run the examples on this page, consider building in a delay between two calls. {"errors":{"detail":"Too Many Requests","message":"Please slow down your requests or upgrade your plan at https://macvendors.com"}}
Let's start with the solution:
Step by Step solution about How to resolve the algorithm MAC vendor lookup step by step in the AppleScript programming language
Source code in the applescript programming language
set apiRoot to "https://api.macvendors.com"
set macList to {"88:53:2E:67:07:BE", "D4:F4:6F:C9:EF:8D", ¬
"FC:FB:FB:01:FA:21", "4c:72:b9:56:fe:bc", "00-14-22-01-23-45"}
on lookupVendor(macAddr)
global apiRoot
return do shell script "curl " & apiRoot & "/" & macAddr
end lookupVendor
set table to { lookupVendor(first item of macList) }
repeat with burger in macList's items 2 thru -1
delay 1.5
set end of table to lookupVendor(burger)
end repeat
set text item delimiters to linefeed
return table as string
set savedTID to text item delimiters
set text item delimiters to linefeed
set tableText to table as string
set text item delimiters to savedTID
return tableText
You may also check:How to resolve the algorithm Sequence of non-squares step by step in the Ol programming language
You may also check:How to resolve the algorithm 99 bottles of beer step by step in the Batch File programming language
You may also check:How to resolve the algorithm Compound data type step by step in the Delphi programming language
You may also check:How to resolve the algorithm Execute Brain step by step in the 68000 Assembly programming language
You may also check:How to resolve the algorithm Giuga numbers step by step in the Ring programming language