MAC vendor lookup: Difference between revisions

no edit summary
(Scala solution added)
No edit summary
Line 535:
FC:FB:FB:01:FA:21 Cisco Systems, Inc
D4:F4:6F:C9:EF:8D Apple, Inc.</pre>
 
=={{header|Ring}}==
<lang ring>
# Project: MAC Vendor Lookup
# Date : 2018/07/14
# Author: Gal Zsolt (~ CalmoSoft ~)
# Email : <calmosoft@gmail.com>
 
load "stdlib.ring"
macs = ["FC-A1-3E","FC:FB:FB:01:FA:21","88:53:2E:67:07:BE","D4:F4:6F:C9:EF:8D"]
for mac = 1 to len(macs)
lookupvendor(macs[mac])
next
 
func lookupvendor(mac)
url = download("api.macvendors.com/" + mac)
see url + nl
</lang>
Output:
<pre>
Samsung Electronics Co.,Ltd
Cisco Systems, Inc
Intel Corporate
Apple, Inc.
</pre>
 
=={{header|Ruby}}==
<lang ruby>require 'net/http'
2,468

edits