Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

ani-up

0.0.1 • Public • Published

ani-up

Build Status NPM version

ani-up is a Node.js module that acts as a wrapper for the MyAnimeList and Hummingbird APIs. It currently supports search, user authentication, and list updating.

Installation

To install, run npm install ani-up in your project's home directory. If you need the latest, you can clone this repository - just make sure you install all the dependencies (see Contributing below).

Usage


Check out the documentation for detailed information on using ani-up.


MyAnimeList & Hummingbird

Most MAL and Hummingbird functions require 1) an API key and 2) a valid username and password for those sites. Currently, this module looks for a creds.js file to store your login credentials to MAL (and Hummingbird) in the project's home directory. Here's the basic format:

var creds = {}
 
creds.MAL_API_KEY = "your key here"
 
creds.MAL_USERNAME = "your username here"
creds.MAL_PASSWORD = "your password here"
 
creds.HUMMINGBIRD_API_KEY = "your key here"
 
creds.HUMMINGBIRD_EMAIL = "your email here"
creds.HUMMINGBIRD_USERNAME = "your username here"
creds.HUMMINGBIRD_PASSWORD = "your password here"
 
module.exports = creds;

With that, you can start calling the MAL and Hummingbird functions in your application. To obtain the MAL and Hummingbird submodules, you simply require them like so:

var aniup = require('ani-up');        // the entire module
var mal = aniup.mal;                  // the MAL module
var hummingbird = aniup.hummingbird;  // the hummingbird module

Here's a example that uses the Hummingbird search function.

var aniup = require('ani-up');
var hummingbird = aniup.hummingbird;
 
hummingbird.searchTopResult('barakamon', function(err, result) {
    if(err) {
        console.log(err);
    }   
    else {
        if(result) {
            console.log("Title: \t" + result.title);
        }
    }   
}); 

Parser

Parser is a standalone video file name parser that is bundled with this module. If you only need to use the parser (and neither the MAL nor Hummingbird functions), then you do not need to have a creds.js file.

require('aniup').parser;       // the proper way
require('aniup/lib/parser');   // only if you don't have/need creds.js

Running the demos

This Node.js module contains some basic demos in the examples/ directory. To run them, run these commands from the ani-up directory.

node example/mal-demo.js [optional search query]

node example/hummingbird-demo.js [optional search query]

Contributing

Help is always welcome. Continue reading if you would like to set up development for this project! There's a lot of cool features and additions planned, so head over to the wiki for some ideas.

Dependencies

  • request - simplified HTTP request client
  • node-xml2js - XML to JavaScript object converter (soon)

For contributors to ani-up

  • mocha - simple, flexible, fun javascript test framework for node.js & the browser

Installing dependencies

npm install [module name]

Running the tests

Note: requires the mocha node module to run.

npm test

Install

npm i ani-up

DownloadsWeekly Downloads

0

Version

0.0.1

License

Apache-2.0

Last publish

Collaborators

  • avatar