MAC vendor lookup: Difference between revisions
Content added Content deleted
(→{{header|PowerShell}}: Add implementation.) |
(→{{header|Scheme}}: Add implementation.) |
||
Line 1,146: | Line 1,146: | ||
macs.foreach(mac => println(lookupVendor(mac))) |
macs.foreach(mac => println(lookupVendor(mac))) |
||
}</lang> |
}</lang> |
||
=={{header|Scheme}}== |
|||
{{trans|Applescript}} |
|||
{{works with|Chicken Scheme}} |
|||
{{libheader|http-client}} |
|||
<lang scheme>(import http-client (chicken io)) |
|||
(define api-root "http://api.macvendors.com") |
|||
(define mac-addresses '("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")) |
|||
(define get-vendor (lambda (mac-address) |
|||
(with-input-from-request (string-append api-root "/" mac-address) |
|||
#f read-string))) |
|||
(map (lambda (burger) (display (get-vendor burger)) (newline) (sleep 2)) |
|||
mac-addresses)</lang> |
|||
{{Out}} |
|||
<pre>Intel Corporate |
|||
Apple, Inc. |
|||
Cisco Systems, Inc |
|||
PEGATRON CORPORATION |
|||
Dell Inc.</pre> |
|||
=={{header|Tcl}}== |
=={{header|Tcl}}== |