chrishardinge / nbn-lookup
检查给定地址的NBN可用性。
v0.1.0
2018-09-30 12:28 UTC
Requires
- php: ^7.1.3
- guzzlehttp/guzzle: ^6.0
This package is auto-updated.
Last update: 2024-09-29 04:26:06 UTC
README
一个简单的包,用于检查给定地址的NBN可用性。
这是一个初始版本,功能最少,因此可能会有破坏性更改。
通过Composer安装
$ composer require chrishardinge/nbn-lookup
用法
use ChrisHardinge\NbnLookup\Search; $search = new Search(); $result = $search->byAddress("Level 40 360 Elizabeth Street, Melbourne Victoria 3000");
以下是返回数据的示例。为了便于查看,我使用了 json_encode($result)
{ "timestamp": 1538304606287, "location": { "id": "LOC000047125105", "formattedAddress": "L 40 360 ELIZABETH ST MELBOURNE VIC 3000 Australia", "latitude": -37.810952, "longitude": 144.961931 }, "servingArea": { "csaId": "CSA300000010316", "techType": "FTTC", "serviceType": "Fixed line", "serviceStatus": "in_construction", "serviceCategory": "brownfields", "rfsMessage": "Oct-Dec 2018", "description": "Exhibition" }, "addressDetail": { "id": "LOC000047125105", "latitude": -37.810952, "longitude": 144.961931, "reasonCode": "FTTC_NA", "serviceType": "Fixed line", "serviceStatus": "in_construction", "techType": "FTTC", "rfsMessage": "Oct-Dec 2018", "formattedAddress": "L 40 360 ELIZABETH ST MELBOURNE VIC 3000 Australia", "frustrated": false } }
您也可以通过以下方式获得相同的结果
$search->byLocId('LOC000047125105');
如果API中没有可用详情,则将返回null。
许可证
MIT许可证(MIT)。有关更多信息,请参阅 LICENSE