naverdict
Unofficial naver dictionary API via DOM parsing.
Last updated a month ago by seia .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install naverdict 
SYNC missed versions from official npm registry.

naverDict

Unofficial naver dictionary API wrapper.

Table of Contents


Installation

  • Yarn
yarn add naverDict
  • NPM
npm i naverDict

Usage

const naverDict = require('naverDict')

searchDictionary

  • Returns Promise
naverDict.searchDictionary('아리랑', {
  maximum: 5, // NOTE: Maximum word length is always 5.
  language: 'ko', // NOTE: See #availableLanguages (in README.md)
  raw: false // NOTE: If this set true, word objects won't serialized and include raw html values. In this library, I use `cheerio` to extract text.
})

Serialized data

  • If raw option is not set. (default)
{
  ...,
  map: { // NOTE: `map` is shortcut to `searchResultMap.searchResultListMap`
    WORD: {
      items: [.../* Words are here */]
    },
    ... // NOTE: Other ranges (such as `idiom`, `meaning`, `examples`, ...)
  }
}

serializeWordObject

  • Returns Object (Serialized word)
naverDict.serializeWordObject(wordObject)

availableLanguages

  • Array
[
  'ko', 'en', 'zh', 'ja', 'fr', 'es', 'de', 'vi'
]

requestHeaders

  • Object
{
  Accept: '*/*',
  DNT: 1,
  Host: 'ko.dict.naver.com',
  Cookie: 'nid_slevel=1; nid_enctp=1; nx_ssl=2',
  'Accept-Language': 'en,ko-KR;q=0.9,ko;q=0.8,en-US;q=0.7',
  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36',
  'Sec-Fetch-Mode': 'no-cors',
  'Sec-Fetch-Site': 'same-site',
  'Cache-Control': 'no-cache',
  'upgrade-insecure-requests': 1
}

Current Tags

  • 1.0.0                                ...           latest (a month ago)

1 Versions

  • 1.0.0                                ...           a month ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 12
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |