Use MyAnimeList (MAL) API to generate a
KataManga_structure_and_data.sql
SQL script to populate the DB.
Berserk — Credit: Dark Horse Comics
Run ./mal_token.sh
and follow the instruction to generate the
mal_token.json
file. Then, run node index.js
to generate the
KataManga_structure_and_data.sql
SQL file.
This bash script aim to create the mal_token.json
file with
the access token. It follows the MyAnimeList API Authorization
Documentation, to
create an OAuth 2.0 access with PKCE, and
get the access token.
This node script calls:
lib/top.js
that will generatedata/tmp/top100.json
anddata/tmp/top100details.json
. These 2 files contains the top 100 mangas' details and are generated from the MAL API.lib/sqlgen.js
that will generate theINSERT
SQL statement to populate the DB, based on data provided by the files in step 1 and the list of genres (data/init/genres.json
), created from https://myanimelist.net/info.php?go=genre. The generated file will be stored asdata/data_top100.sql
.- The script will finally merge
data/init/structure.sql
,data/data_top100.sql
,data/init/constraints.sql
to create thedata/KataManga_structure_and_data.sql
that can be used to create the DB with its data.