2017-25 © Pedro Peláez
 

library china-same-name

china same name query

image

xu42/china-same-name

china same name query

  • Monday, July 16, 2018
  • by xu42
  • Repository
  • 1 Watchers
  • 3 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

china-same-name

🇨🇳中国同名同姓查询, (*1)

Install

Via Composer, (*2)

``` bash $ composer require xu42/china-same-name, (*3)


## Usage ⚠️注意: 目前已支持河南、浙江全省及其各市查询. ``` php require_once 'vendor/autoload.php'; // 查询在北京与张伟同名的人数 $count = \Xu42\ChinaSameName\ChinaSameName::count('张伟', 'beijing'); // 查询在河南全省与张伟同名的人数 $count = \Xu42\ChinaSameName\ChinaSameName::count('张伟', 'henan'); // 查询在河南郑州与张伟同名的人数 $count = \Xu42\ChinaSameName\ChinaSameName::count('张伟', 'henan.zhengzhou'); var_dump($count);

Contributing

  1. Fork me
  2. 参考 henan.default , 补充完善 例如要添加台湾省的配置,需按照下列格式进行补充
const CONFIG = [
    'henan' => [
        ... //此处配置省略
    ],
    'taiwang' => [
        // common 为本省一些通用的配置, 例如method\key\pattern等,优先级低于具体地级市配置
        'common' => [
            'method' => 'get',
            'key' => 'data.count',
        ],
        // default 为全省的统计
        'default' => [
            'method' => 'get', //get or post
            'url' => 'https://people.gov.cn/count.json?name=@NAME@', // @NAME@会被替换为URL编码后的姓名 (post暂不支持)
            'key' => 'data.count', //对于接口返回是Json格式的,可以通过此字段进行提取 {'data':{'count':123}}
            'pattern' => '#all(\d+)people#', //对于接口返回非Json格式的文本的,可以通过正则匹配进行提取(暂不支持 欢迎提交PR或后续有需求再加)
            'params' => [], //method=post时的参数 (post暂不支持)
        ],
        // 台北市统计
        'taibei' => [
            ... //此处配置省略
        ],
    ],
    ... //此处配置省略
];

  1. Pull Request

License

The MIT License (MIT). Please see License File for more information., (*4)

The Versions

16/07 2018

dev-master

9999999-dev

china same name query

  Sources   Download

MIT

The Requires

 

中国同名同姓 同名查询

16/07 2018

0.0.2

0.0.2.0

china same name query

  Sources   Download

MIT

The Requires

 

中国同名同姓 同名查询

16/07 2018

dev-hotfix/support_zhejiang

dev-hotfix/support_zhejiang

china same name query

  Sources   Download

MIT

The Requires

 

中国同名同姓 同名查询

15/07 2018

0.0.1

0.0.1.0

china same name query

  Sources   Download

MIT

The Requires

 

中国同名同姓 同名查询