MAC vendor lookup: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: added syntax colouring, marked p2js incompatible) |
(MAC Vendor Lookup en FreeBASIC) |
||
Line 397: | Line 397: | ||
Cisco Systems, Inc |
Cisco Systems, Inc |
||
Not Found |
Not Found |
||
</pre> |
|||
=={{header|FreeBASIC}}== |
|||
<lang freebasic>Function pipeout(Byval s As String = "") Byref As String |
|||
Var f = Freefile |
|||
Dim As String tmp |
|||
Open Pipe s For Input As #f |
|||
s = "" |
|||
Do Until Eof(f) |
|||
Line Input #f, tmp |
|||
s &= tmp |
|||
Loop |
|||
Close #f |
|||
Return s |
|||
End Function |
|||
Function lookupvendor(webpage As String, mac As String) As String |
|||
Return pipeout("powershell " + "(Invoke-WebRequest " + webpage + mac + ")") |
|||
End Function |
|||
Dim As String macs(1 To 4) = {"FC-A1-3E","FC:FB:FB:01:FA:21","88:53:2E:67:07:BE","D4:F4:6F:C9:EF:8D"} |
|||
For i As Integer = 1 To Ubound(macs) |
|||
Var d = lookupvendor("api.macvendors.com/", macs(i)) |
|||
Var e = Instr(d, "RawContent") |
|||
Print Mid(d, 66, e-66) |
|||
Next i |
|||
Sleep |
|||
</lang> |
|||
{{out}} |
|||
<pre> |
|||
Samsung Electronics Co.,Ltd |
|||
Cisco Systems, Inc |
|||
Intel Corporate |
|||
Apple, Inc. |
|||
</pre> |
</pre> |
||