Coder Social home page Coder Social logo

doubanfm-sdk's Introduction

doubanfm-sdk

js-standard-style Build Status codecov npm

豆瓣 FM SDK

使用

import WebSDK from 'doubanfm-sdk'

const wsdk = new WebSDK()

const operate = (method, opt, cb) => {
  wsdk[method](opt, (err, data) => {
    if (err) return console.error(err) // error handle
    cb && cb(data)
  })
}

API

获取验证码 id

operate('captchaId', null, id => {
  // todo
})

登录

const opt = {
  alias: '',
  form_password: '',
  captcha_solution: '',
  captcha_id: '',
  source: 'radio',
  task: 'sync_channel_list'
}
operate('login', opt, data => {
  // todo
})

登出

operate('logout', () => {
  // todo
})

获取频道

operate('channels', opt, data => {
  // todo
})

获取热门频道

operate('hotChannels', opt, data => {
  // todo
})

加心

operate('star', opt, data => {
  // todo
})

取消红心

operate('unstar', opt, data => {
  // todo
})

不再播放

operate('neverPlayAgain', opt, data => {
  // todo
})

获取歌词

operate('lyric', opt, data => {
  // todo
})

获取用户信息

operate('userInfo', opt, data => {
  // todo
})

License

MIT

doubanfm-sdk's People

Contributors

xwartz avatar

Watchers

 avatar  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.