Skip to content
This repository was archived by the owner on Apr 23, 2019. It is now read-only.
/ annict.js Public archive

📀 Annict API client library for JavaScript ( & TypeScript) 📺

License

Notifications You must be signed in to change notification settings

nukosuke/annict.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

34ce77c · Apr 23, 2019
Sep 22, 2016
Feb 13, 2019
Feb 13, 2019
Feb 4, 2018
Mar 2, 2017
Jan 20, 2017
Jan 20, 2017
Feb 13, 2019
Feb 4, 2018
Feb 4, 2018
Apr 23, 2019
Jun 16, 2016
Jun 29, 2016
Feb 13, 2019
Feb 13, 2019
Oct 7, 2016
Mar 2, 2017
Sep 6, 2016
Feb 13, 2019

Repository files navigation

Notice

Annict maintainer announced REST API as deprecated. https://twitter.com/shimbaco/status/1117113862514335744?s=20

This library is no longer maintained. Please use GraphQL instead. https://developers.annict.jp/graphql-api/

npm version Bower version Build Status Dependency Status devDependency Status Greenkeeper badge

annict.js

annict.js is client library for anime tracking service, Annict. This library supports Node.js and browser.

Install

NPM

npm install annict --save
# or if you use Yarn for package managing
yarn add annict

Bower

bower install annict --save

Usage

See also Document for more details.

Node.js

var Annict = require('annict').default;

var annict = new Annict();

annict.OAuth.token(
  CLIENT_ID,
  CLIENT_SECRET,
  GRANT_TYPE,
  REDIRECT_URI,
  CODE
)
.then(response => response.json())
.then(token => {

  annict.client.setToken(token.access_token);

  annict.Work.get({ filter_title: 'shirobako' })
  .then(response => response.json())
  .then(works    => console.log(works));

  annict.Me.Record.create({
    episode_id: 5013,
    comment: 'あぁ^~心がぴょんぴょんするんじゃぁ^~',
    rating: 5.0,
    share_twitter: 'true',
    share_facebook: 'false'
  })
  .then(response => response.json())
  .then(record   => console.log(record));

});

Browser

<body>
    ...
    <script src='/js/annict.min.js'></script>
    <script>
        var annict = new Annict();
    </script>
</body>

Available methods are partly differ between Node.js and browser.

License

Copyright (c) 2018 nukosuke
This software is licensed under MIT license. http://opensource.org/licenses/mit-license.php