Skip to content

chussum/delibee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

74 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Delibee

NPM Version NPM Downloads Build Status Test Coverage

delibee
Delivery tracking library on Node.js.

Prerequisites

Node.js >= 7.6

Required Server Dependencies

NOTE: Sometimes Delibee use Headless Chrome. (e.g. CJλŒ€ν•œν†΅μš΄)

Debian (e.g. Ubuntu)

sudo apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

CentOS

sudo yum install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc -y

Issues

Feel free to submit issues and enhancement requests.

Usage

npm install delibee

On Express Framework

const express = require('express')
const delibee = require('delibee')({
  timeout: 10000, // default timeout value is '10000'
  locale: 'en' // default locale is 'ko'
})
const app = express()

app.get('/tracking/companies', async (req, res) => {
  const companies = await delibee.company()
  res.send(companies)
})

app.get('/tracking', async (req, res) => {
  const company = req.query.company
  const invoiceNo = req.query.invoice_no
  const invoice = await delibee.tracking(company, invoiceNo)
  res.send(invoice)
})

app.listen(3000)

Http Request Example

http://127.0.0.1:3000/tracking?company={delivery_company_code}&invoice_no={invoice_number}

Delivery Company Code

Company Name Comapny Code
μš°μ²΄κ΅­νƒλ°° EPOST
CJλŒ€ν•œν†΅μš΄ CJ
ν•œμ§„νƒλ°° HANJIN
둯데택배 (ꡬ. ν˜„λŒ€νƒλ°°) LOTTE
λ‘œμ  νƒλ°° LOGEN
λ“œλ¦Όνƒλ°° (ꡬ. KGλ‘œμ§€μŠ€) DREAM
CVSnet νŽΈμ˜μ νƒλ°° CVSNET
CU νŽΈμ˜μ νƒλ°° CU

Response

Key Description
deliveryCompany νƒλ°°νšŒμ‚¬μ •λ³΄
invoiceNumber 솑μž₯번호
senderName 보낸이
senderAddr μΆœλ°œμ§€/μ£Όμ†Œ
receiverName λ°›λŠ”μ΄
receiverAddr 도착지/μ£Όμ†Œ
statusCode λ°°μ†‘μƒνƒœμ½”λ“œ
statusText λ°°μ†‘μƒνƒœ
history 배솑내역

DeliveryCompany

Key Description
code νƒλ°°νšŒμ‚¬μ½”λ“œ
name νƒλ°°νšŒμ‚¬

History

Key Description
dateTime μ‹œκ°„ (timestamp)
dateString μ‹œκ°„ (YYYY.MM.DD HH:mm)
location μœ„μΉ˜
tel μ „ν™”λ²ˆν˜Έ
remark 택배사 제곡 λ°°μ†‘μƒνƒœ
statusCode λ°°μ†‘μƒνƒœμ½”λ“œ
statusText λ°°μ†‘μƒνƒœ

Status

StatusCode StatusText
-1 μ•Œμˆ˜μ—†μŒ
10 μ ‘μˆ˜λŒ€κΈ°
11 μž”λ₯˜
20 μ ‘μˆ˜
30 μ§‘ν•˜
40 배솑쀑(좜고)
50 배솑쀑(μž…κ³ )
55 μ˜€λ„μ°©
60 배달쀀비쀑
65 배달쀑
70 λ°°λ‹¬μ™„λ£Œ
71 미배달
80 μΈμˆ˜ν™•μΈ

Response Expample

{
  "success": true,
  "invoice": {
    "deliveryCompany": {
      "code": "CJ",
      "name": "CJλŒ€ν•œν†΅μš΄"
    },
    "invoiceNumber": "612566673760",
    "senderName": "ν…Œ*",
    "senderAddr": "",
    "receiverName": "이*",
    "receiverAddr": "",
    "history": [
      {
        "dateTime": 1512043020000,
        "dateString": "2017.11.30 20:57",
        "location": "μΈμ²œκ°€μ’Œμ‹¬κ³‘",
        "tel": "",
        "remark": "λ³΄λ‚΄μ‹œλŠ” κ³ κ°λ‹˜μœΌλ‘œλΆ€ν„° μƒν’ˆμ„ μΈμˆ˜λ°›μ•˜μŠ΅λ‹ˆλ‹€",
        "statusCode": 20,
        "statusText": "μ ‘μˆ˜"
      },
      {
        "dateTime": 1512055800000,
        "dateString": "2017.12.01 00:30",
        "location": "뢀평",
        "tel": "",
        "remark": "λ¬Όλ₯˜ν„°λ―Έλ„λ‘œ μƒν’ˆμ΄ μ΄λ™μ€‘μž…λ‹ˆλ‹€.",
        "statusCode": 40,
        "statusText": "배솑쀑(좜고)"
      },
      {
        "dateTime": 1512124740000,
        "dateString": "2017.12.01 19:39",
        "location": "λŒ€μ „HUB",
        "tel": "",
        "remark": "λ°°μ†‘μ§€μ—­μœΌλ‘œ μƒν’ˆμ΄ μ΄λ™μ€‘μž…λ‹ˆλ‹€.",
        "statusCode": 40,
        "statusText": "배솑쀑(좜고)"
      },
      {
        "dateTime": 1512168420000,
        "dateString": "2017.12.02 07:47",
        "location": "덕진",
        "tel": "",
        "remark": "κ³ κ°λ‹˜μ˜ μƒν’ˆμ΄ 배솑지에 λ„μ°©ν•˜μ˜€μŠ΅λ‹ˆλ‹€.(λ°°μ†‘μ˜ˆμ •:--)",
        "statusCode": 50,
        "statusText": "배솑쀑(μž…κ³ )"
      },
      {
        "dateTime": 1512178800000,
        "dateString": "2017.12.02 10:40",
        "location": "μ „λΆμ „μ£Όμ†‘μ²œ",
        "tel": "",
        "remark": "κ³ κ°λ‹˜μ˜ μƒν’ˆμ„ 배솑할 μ˜ˆμ •μž…λ‹ˆλ‹€.(11∼13μ‹œ)(배솑담당:--)",
        "statusCode": 65,
        "statusText": "배달쀑"
      },
      {
        "dateTime": 1512180420000,
        "dateString": "2017.12.02 11:07",
        "location": "μ „λΆμ „μ£Όμ†‘μ²œ",
        "tel": "",
        "remark": "κ³ κ°λ‹˜μ˜ μƒν’ˆμ΄ λ°°μ†‘μ™„λ£Œ λ˜μ—ˆμŠ΅λ‹ˆλ‹€.(담당사원:--)",
        "statusCode": 70,
        "statusText": "λ°°λ‹¬μ™„λ£Œ"
      }
    ],
    "statusCode": 70,
    "statusText": "λ°°λ‹¬μ™„λ£Œ"
  }
}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/moodselah/delibee

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Contributors

Company Name Contributor
μš°μ²΄κ΅­νƒλ°° @moodselah
CJλŒ€ν•œν†΅μš΄ @moodselah
ν•œμ§„νƒλ°° @moodselah
둯데택배 (ꡬ. ν˜„λŒ€νƒλ°°) @moodselah
λ‘œμ  νƒλ°° @moodselah
λ“œλ¦Όνƒλ°° (ꡬ. KGλ‘œμ§€μŠ€) @moodselah
CVSnet νŽΈμ˜μ νƒλ°° @moodselah
CU νŽΈμ˜μ νƒλ°° @moodselah

License

MIT LICENSE