Moefou 萌否 API wrapper
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
README.md
package.json

README.md

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