Skip to content

mimosa/geocoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

部署说明

cd geocoder

  • 加执行权限

chmod +x ./bin/migrate.sh

  • 请确保 redis-server 运行
  • 导入 手机号段 及 身份证号段 数据

./bin/migrate.sh

  • 运行 Jetty

mizuno

  • 打成 war

bundle exec warble

GEO 调用说明

IP地址

手机号

凯翔小区

身份证

国内天气 调用说明

IP定位

指定城市

短网址 调用说明

新浪

腾讯

短信发送 调用说明

兑换 API_KEY

curl \
  -H 'Content-Type: application/json' \
  -i 'http://open.shou65.com/smssender/token?login=用户名&passwd=密码'   
  • 返回
{
  "X-Auth-Token": "密钥"
}

发送短信

  • 带返回的 POST
  • 群发,用 逗号 隔开,多个手机号
curl \
  -X POST \
  -H 'X-Auth-Token: 密钥' \
  -H 'Content-Type: application/json' \
  -d '{ "mobile": "手机号", "content": "短信测试" }' \
  -i 'http://open.shou65.com/smssender'
  • 单发,返回
{
  "success": true,
  "message": "短信发送成功",
  "fee": "当前发送,消耗的短信条数"
}
  • 群发,返回
{
  "success":true,
  "message":"短信队列成功。",
  "pending": ["数组,未发送的手机号"],
  "sent": ["数组,发送成功的手机号"],
  "fail": ["数组,发送失败的手机号"],
  "fee": "当前发送,消耗的短信条数"
}

查询余额

curl \
  -H 'X-Auth-Token: 密钥' \
  -H 'Content-Type: application/json' \
  -i 'http://open.shou65.com/smssender'
  • 返回
{
    "success": true,
    "message": {
        "sent": "已发送条数",
        "balance": "剩余条数"
    }
}

简单的配置文件 调用说明

创建设置文件

  • '/api/settings/{配置名称}';
  • 跳转至查看;
curl \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '[{"area_code":"021", "pinyin": "shanghai", "country": "中国", "city": "上海"},{"area_code":"0755", "pinyin": "shenzhen", "country": "中国", "city": "深圳"}]' \
  -i 'http://open.shou65.com/settings/cities'

查看设置

  • '/api/settings/{密钥}';
curl \
  -H 'Content-Type: application/json' \
  -i 'http://open.shou65.com/settings/S2hmUWticlcxd1U9'
  • 返回
[
  {
    area_code: "021",
    pinyin: "shanghai",
    country: "中国",
    city: "上海"
  },
  {
    area_code: "0755",
    pinyin: "shenzhen",
    country: "中国",
    city: "深圳"
  }
]

查询设置

  • '/api/settings/{密钥}/search/{字段}?q={关键字}';
curl \
  -H 'Content-Type: application/json' \
  -i 'http://open.shou65.com/settings/S2hmUWticlcxd1U9/search/pinyin?q=sh'
  • 返回
[
  {
    area_code: "021",
    pinyin: "shanghai",
    country: "中国",
    city: "上海"
  },
  {
    area_code: "0755",
    pinyin: "shenzhen",
    country: "中国",
    city: "深圳"
  }
]

中文分词 调用说明

  • POST 适合长文本
curl \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"text":"诺基亚已经活了150年了,还会活下去。死掉的是产品,只是换个活法而已,也许是一个新的开始。"}' \
  -i 'http://open.shou65.com/analyzer'
  • 返回
  [
    "诺基亚", "已经", "150年", "下去", "产品", "活法", "而已", "也许", "一个", "开始"
  ]

GET 适合少量文字

Releases

No releases published

Packages

No packages published