1.3.1 • Published 7 years ago

yscode v1.3.1

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

YSCode

一个简单的云速打码模块.

安装

node:

$ npm install yscode

##示例

const Yscode = require('yscode');
const options = {
    "username": "username",
    "password": "password",
    "softid"  : "softid",
    "softkey" : "softkey"
}
const ys = new Yscode(options);
let header = {
    'Cookie': 'some cookie'
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'
}

let imgUrl = `http://www.baidu.com`;
let type = 1040;

ys
    .header(header)
    .getImg(imgUrl)
    .imgToCode(type, function (result) {
       console.log(result);
})

详细说明

调用云速打码接口:

说明方法名参数名类型必要性
设置请求头.headerheaderObject选填
设置图片地址.getImgimgString必填
设置类型.typetypeString选填 [url, base64] 默认为'url', 如果为base64则会将img作为base64解析
图片转CODE.imgToCodetypeString选填 默认3000
  • 使用Promise:
ys
    .header(header)
    .getImg(imgUrl)
    .imgToCode(type)
    .then(function (result) {
        console.log(result);
    })

or

async function () {
    let result = await ys.header(header).getImg(imgUrl).imgToCode(type);
    console.log(result);
}

License

ISC

1.3.1

7 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago