GithubHelp home page GithubHelp logo

youdao's Introduction

有道词典命令行版服务端

使用方法

替换掉conf/app.toml中的应用id和应用密钥 申请地址在这里 申请地址

替换完之后执行

go build

接着再执行(我把输出的信息都放到exec_log/exec.log中了),之后就可以通过接口进行请求了

./youdao >exec_log/exec.log 2>& 1 &

接口说明

地址

  • fanyi/youdao

请求方式

  • POST (JSON形式)

请求参数

参数名 必选 类型 说明
content string 待翻译的文本

返回参数

参数说明看这里

{
    "code": 0,
    "data": {
        "list": {
            "errorCode": "0",
            "query": "pack",
            "translation": [
                ""
            ],
            "basic": {
                "phonetic": "pæk",
                "uk-phonetic": "pæk",
                "us-phonetic": "pæk",
                "explains": [
                    "n. 包装;一群;背包;包裹;一副",
                ]
            },
            "web": [
                {
                    "key": "pack",
                    "value": [
                        "剥撕式面膜"
                    ]
                },
                {
                    "key": "service pack",
                    "value": [
                        "服务包"
                    ]
                },
                {
                    "key": "expansion pack",
                    "value": [
                        "资料片"
                    ]
                }
            ],
            "l": "en2zh-CHS",
            "returnPhrase": [
                "pack"
            ],
            "isWord": true
        },
        "msg": "查询成功"
    },
    "status": "success",
    "taketime": 28.701952
}

注意事项

我添加了平滑重启功能,用的是这个包 github.com/fvbock/endless 由于windows系统没有某些kill信号,所有本项目无法在windows下运行,推荐使用linux系统

youdao's People

Contributors

wangxingzhen-1 avatar

Stargazers

wxz avatar

Watchers

wxz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.