Giter Club home page Giter Club logo

dorapi's Introduction

Doraemon API

codecov

ドラえもんのひみつ道具等のデータを提供します.

virtualenv activate

. ./dorapi-env/bin/activate

.env ファイル作成

直下に作成.内容は以下:

#!/bin/bash

# [ENV]
ENV=local

# [DB]
DB_NAME=dorapi
DB_USERNAME=admin
DB_PASSWORD=password
DB_ENDPOINT=db
DB_PORT=5432

# [Django]
SECRET_KEY=...

# Google Custom Search
CSE_ID=...          # Custom Search Engine ID
GOOGLE_API_KEY=...

SECRET_KEY は任意 (例:@gey=ud2=ry+_3_u(=jsh9b*y743i=8odr@4ocx5tt*^n6)bqi)

CSE_IDGOOGLE_API_KEY は Google Custom Search API の使用法を参照.

dora_superdatabase seed 作成 (お金かかるのでやらないでください.すでにシードはあります.)

root directory で

python ./backend/shells/gadgets/dora_superdatabase.py 1> ./backend/seeds/gadgets/dora_superdatabase.py 2> ./backend/seeds/gadgets/dora_superdatabase_log.txt

を実行.ひみつ道具 (gadgets) 以外も同様 (後に追加).

Build・起動

docker-compose build
docker-compose up -d

DB リセット / Seed 投入

sh ./backend/shells/db_reset.sh

lint

flake8 . --count --show-source --statistics --ignore="F401, F403, F405, E111, E114, E121, E402, E501, W293, W503, W504"

deploy for Heroku (自分用メモ)

Heroku へログイン

heroku login

docker イメージを push

cd ./backend
heroku container:push web -a dorapi
heroku release:push web -a dorapi

必要なら

heroku ps:scale web=1 -a dorapi

DB データをローカルからコピー

PGUSER=admin PGPASSWORD=password PGHOST=127.0.0.1 heroku pg:push dorapi DATABASE_URL --app dorapi

dorapi's People

Contributors

assqr avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

dorapi's Issues

[TODO] 気づいた問題点

  • スクレイピング失敗してる
{
    "id": "7a708dda-57a5-4c92-aa3f-c8655b13fecb",
    "name": "悪魔のイジワールのききめをなくす薬",
    "ruby": "あくまのいじわーるのききめをなくすくすり",
    "desc": "「",
    "mbooks": [
    {
        "id": "e62026d2-91dd-4171-ac4b-26e3f59346f7",
        "series": "tencomi",
        "volume": "第35巻"
    },
    {
        "id": "746aa159-6034-4e53-afe0-d4f41bc5630b",
        "series": "f_land",
        "volume": "第43巻"
    },
    {
        "id": "77a213ed-d777-4e11-baf1-700e8035eb55",
        "series": "f_collect",
        "volume": "第14巻"
    }
    ]
},
  • [参照] リンク未処理
{
    "id": "af345077-9612-45d4-94e9-86fab0e60402",
    "name": "ふしぎなめがね",
    "ruby": "ふしぎなめがね",
    "desc": "[参照] あいてをみるだけで、うごかせるめがね",
    "mbooks": []
},

スクレイピング リンク位置 バグ

リンク位置不正確

{
  "data": {
    "id": "066ae8c2-8431-4217-b25b-c630e475c1a7",
    "name": "悪魔のイジワールのききめをなくす薬",
    "ruby": "あくまのいじわーるのききめをなくすくすり",
    "href": "/gadget/a#akuma-no-ijiwahru-no-kikime-wo-nakusu-kusuri",
    "desc": "「悪魔のイジワール」の効き目をなくす薬。\n\n「悪魔のイジワール」とは違い、とげのない、つるっとした丸いビンに入っている。",
    "mbooks": [
      {
        "id": "b833d962-8e06-45ae-ba15-48782aa71672",
        "series": "tencomi",
        "volume": "第35巻"
      },
      {
        "id": "cf159b2d-9ba2-4865-bba6-a4ccbcf3ce88",
        "series": "f_land",
        "volume": "第43巻"
      },
      {
        "id": "e4f54608-1109-4edf-b60b-5ab4f9b3e8e5",
        "series": "f_collect",
        "volume": "第14巻"
      }
    ],
    "links": [
      {
        "to_mgadget_id": "3c483b06-b9a1-4558-ae2a-6611f7fbf23f",
        "begin_index": 0,
        "end_index": 8
      },
      {
        "to_mgadget_id": "3c483b06-b9a1-4558-ae2a-6611f7fbf23f",
        "begin_index": 9,
        "end_index": 17
      }
    ]
  }
}

キーワード検索 精度が悪い

アレクサスキル (https://github.com/asSqr/dorapi-skill) ではキーワード検索トップを表示している.

道具の名前そのものを入れても,それを説明に含む関連道具で辞書順で先のものがあるとそれが表示されてしまう.

例:
どこでもドア → 昆虫探索カード

スクレイピング バグ

{
  "id": "45cf088f-218d-45a3-85c1-a52d4ca1ab1e",
  "name": "タイムシーバー",
  "ruby": "たいむしーばー",
  "href": "/gadget/ta#time-ceiver",
  "desc": "で、古道具をオーダーするときに使う道具。\n\n担当者と直接取引できる。",
  "mbooks": [
    {
      "id": "ad80ab65-d2c3-4529-97db-7085273b171b",
      "series": "f_collect",
      "volume": "第1巻"
    },
    {
      "id": "cf574e60-2f8c-4012-874e-e02ba1475703",
      "series": "tencomi",
      "volume": "第1巻"
    },
    {
      "id": "b3155ac6-daaa-433f-8132-33431d59cf6d",
      "series": "f_land",
      "volume": "第2巻"
    }
  ],
  "linked_gadgets": []
},

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.