1.3.1 • Published 9 years ago

yscode v1.3.1

Weekly downloads
1
License
ISC
Repository
-
Last release
9 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

9 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.14

10 years ago

1.0.13

10 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago