Git Product home page Git Product logo

moefou's Introduction

Moefou 萌否 API wrapper

This is a node module that allows you to interact with 萌否API.

Install

npm install moefou

Example

const Moefou = require('moefou')
const m = new Moefou('your_api_key')

// 获取一个用户的基础资料
// http://open.moefou.org/docs/api/user/detail
m.userDetail({ uid: 2127 }, (error, response, body) => {
  if (error) throw error

  console.log(body.response.user)
})

Notice that some methods require a parameter called optionals, which is a JavaScript Object contains optional parameters. You can pass in {} if you do not want specify any optional parameter.

Testing

Fill in apiKey in config-sample.json, rename the file to config.json.

Run tests: mocha

Endpoints

  • api.moefou.org

    • wiki/条目

      • wikis
      • on-air
      • wiki/detail
      • wiki/subs
      • wiki/favs
      • wiki/ratings
      • wiki/relationships
      • wiki/similarity
    • sub/子条目

      • sub/detail
      • sub/favs
      • sub/ratings
      • sub/relationships
    • user/用户

      • user/detail
      • user/favs/wiki
      • user/favs/sub
    • search/搜索

      • search/wiki
      • search/sub
    • fav/收藏

      • fav/add
      • fav/delete
  • moe.fm

    • play/播放接口

      • listen/playlist?api=json
      • ajax/log?log_obj_type=sub&log_type=listen&obj_type=song&api=format
    • web/网页接口

      • explore?api=format
      • music/{wiki_id}?api=format
      • music/{wiki_id}/songs?api=format
      • music/{wiki_id}/favs?api=format
    • other/其他接口

      • search/direct

moefou's People

Stargazers

CMK avatar 頂上ノ月 avatar

Watchers

James Cloos avatar Pengcheng Ding 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.