dongnelibrary 0.1.21 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.travis.yml CHANGED
@@ -1,4 +1,3 @@
1
1
  language: node_js
2
2
  node_js:
3
- - v8
4
- - v6
3
+ - v10
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 autoscripts@gmail.com
3
+ Copyright (c) 2016 Bob Hwang
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -7,36 +7,41 @@
7
7
  > 도서관 책을 빌릴 수 있는지 확인하는 프로그램
8
8
 
9
9
 
10
- 도서관 이름을 생략하면 모든 도서관을 검색한다. [블로그](https://agvim.wordpress.com/2017/01/20/check-if-a-library-book-was-rented/)에서 간단한 설명을 볼 수 있다.
10
+ 도서관 이름을 생략하면 모든 도서관을 검색한다.
11
+ [블로그](https://agvim.wordpress.com/2017/01/20/check-if-a-library-book-was-rented/)에서 간단한 설명을 볼 수 있다.
11
12
 
12
- ## 1. With npm
13
+ ## install with git
13
14
 
14
- Installation
15
+ git clone https://github.com/afrontend/dongnelibrary
16
+ cd dongnelibrary
17
+ npm ci
18
+ chmod a+x src/dongnelibrary_cli.js
15
19
 
16
- npm install dongnelibrary -g
20
+ node ./src/dongnelibrary_cli.js
21
+ node ./src/dongnelibrary_cli.js -a
22
+ node ./src/dongnelibrary_cli.js -A -t javascript -l 남양
23
+ node ./src/dongnelibrary_cli.js -A -t javascript -l 남양,판교
24
+ npm test
17
25
 
18
- Usage
26
+ ## install with NPM
19
27
 
28
+ npm install dongnelibrary -g
20
29
  dongnelibrary
21
- dongnelibrary -i
22
- dongnelibrary -t javascript -l 남양도서관
23
- dongnelibrary -t javascript -l 남양,판교
24
-
25
- [![asciicast](https://asciinema.org/a/E7Rjmrp78RxOno0eHSr7s1D5p.svg)](https://asciinema.org/a/E7Rjmrp78RxOno0eHSr7s1D5p)
30
+ dongnelibrary -a
31
+ dongnelibrary -A -t javascript -l 남양도서관
32
+ dongnelibrary -A -t javascript -l 남양,판교
26
33
 
27
- ## 2. With Docker
34
+ [![asciicast](https://asciinema.org/a/359304.svg)](https://asciinema.org/a/359304)
28
35
 
29
- Installation
36
+ ## Using with docker
30
37
 
31
38
  docker pull frontendwordpress/dongnelibrary
32
-
33
- Usage
34
-
39
+ docker run --rm frontendwordpress/dongnelibrary dongnelibrary
35
40
  docker run --rm frontendwordpress/dongnelibrary dongnelibrary -a
36
- docker run --rm frontendwordpress/dongnelibrary dongnelibrary -l 여주,판교 -t 자바
37
- docker run --rm frontendwordpress/dongnelibrary dongnelibrary -l 여주도서관 -t 자바
41
+ docker run --rm frontendwordpress/dongnelibrary dongnelibrary -A -l 여주,판교 -t 자바
42
+ docker run --rm frontendwordpress/dongnelibrary dongnelibrary -A -l 여주도서관 -t 자바
38
43
 
39
- 아래 함수를 `~/.bashrc` 파일에 추가하여 간편하게 사용할 수 있다.
44
+ 아래 함수를 `~/.bashrc` 파일에 추가하여 사용할 수 있다.
40
45
 
41
46
  ```bash
42
47
  dongne () {
@@ -44,17 +49,15 @@ dongne () {
44
49
  }
45
50
  ```
46
51
 
47
- dongne -l 여주,판교 -t 자바
48
- dongne -l 여주도서관 -t 자바
52
+ dongne
53
+ dongne -a
54
+ dongne -A -l 여주,판교 -t 자바
55
+ dongne -A -l 여주도서관 -t 자바
49
56
 
50
- ## 3. With JavaScript
51
-
52
- Installation
57
+ ## Using with JavaScript
53
58
 
54
59
  npm install dongnelibrary
55
60
 
56
- Usage
57
-
58
61
  ```javascript
59
62
  const dl = require('dongnelibrary');
60
63
  dl.search({
@@ -70,29 +73,14 @@ dl.search({
70
73
  });
71
74
  ```
72
75
 
73
- ## 4. Git
74
-
75
- Installation
76
-
77
- git clone https://github.com/afrontend/dongnelibrary
78
- cd dongnelibrary
79
- npm install
80
- chmod a+x src/dongnelibrary_cli.js
81
-
82
- Usage
83
-
84
- ./src/dongnelibrary_cli.js -i
85
- ./src/dongnelibrary_cli.js -t javascript -l 남양
86
- ./src/dongnelibrary_cli.js -t javascript -l 남양,판교
87
- npm test
88
-
89
76
  ## 검색 가능한 도서관
90
77
 
91
- * [경기도립도서관][gg-url] (중앙, 평택, 광주, 여주, 포천, 김포)
92
- * [성남시도서관][snlib-url] (중원어린이, 중앙, 분당, 구미, 중원, 무지개, 판교, 수정, 운중, 서현, 판교어린이)
93
- * [오산시도서관][osan-url] (오산중앙, 청학, 햇살마루, 양산, 초평, 꿈두레)
94
- * [화성시립도서관][hscity-url] (남양, 태안, 삼괴, 병점, 샘내작은, 두빛나래어린이, 봉담, 둥지나래어린이, 기아행복마루, 동탄복합문화센터, 송산, 정남, 비봉작은, 진안, 동탄중앙이음터)
95
- * [군포시도서관][gunpo-url] (산본, 당동, 대야, 어린이, 이동, 중앙, 누리천문대, 시청북카페밥상머리, 부곡, 당정문화, 동화나무어린이, 금정작은, 재궁꿈나무, 궁내동작은, 노루목작은, 버드나무에부는바람작은, 꿈쟁이, 우리마을, 북카페사랑아이엔지, 산본역, 하늘정원작은, 꿈이지, 꿈드림작은, 여담작은)
78
+ * [경기교육통합도서관][gg-url] (경기중앙교육도서관,경기평택교육도서관,경기광주교육도서관,경기여주가남교육도서관,경기포천교육도서관,경기김포교육도서관,경기과천교육도서관,경기성남교육도서관,경기화성교육도서관,경기의정부교육도서관,경기평생교육학습관)
79
+ * [군포시도서관][gunpo-url] (산본도서관,당동도서관,대야도서관,어린이도서관,이동도서관,중앙도서관,누리천문대,시청북카페밥상머리,부곡도서관,당정문화도서관,동화나무어린이도서관,금정작은도서관,재궁꿈나무도서관,궁내동작은도서관,노루목작은도서관,버드나무에부는바람작은도서관,꿈쟁이도서관,우리마을도서관,북카페사랑아이엔지,산본역도서관,하늘정원작은도서관,꿈이지,꿈드림작은도서관,여담작은도서관)
80
+ * [성남시도서관][snlib-url] (논골도서관,중원어린이도서관,중앙도서관,분당도서관,구미도서관,해오름도서관,중원도서관,무지개도서관,판교도서관,위례도서관,수정도서관,책테마파크도서관,운중도서관,서현도서관,복정도서관,판교어린이도서관)
81
+ * [오산시도서관][osan-url] (중앙도서관,꿈두레도서관,초평도서관,햇살마루도서관,청학도서관,양산도서관,소리울도서관,무지개도서관,고현초꿈키움도서관,쌍용예가시민개방도서관)
82
+ * [화성시립도서관][hscity-url] (남양도서관,태안도서관,삼괴도서관,병점도서관,샘내도서관,두빛나래도서관,봉담도서관,둥지나래도서관,목동이음터도서관,기아행복마루도서관,동탄복합문화센터도서관,송산도서관,정남도서관,비봉도서관,진안도서관,중앙이음터도서관,양감도서관,다원이음터도서관,송린이음터도서관,팔탄도서관,마도도서관,봉담커피앤북도서관,왕배푸른숲도서관,노을빛도서관,서연이음터도서관,호연이음터도서관,늘봄이음터도서관)
83
+ * [수원시도서관][suwon-url] (선경도서관,중앙도서관,영통도서관,슬기샘도서관,바른샘도서관,지혜샘도서관,서수원도서관,북수원도서관,태장마루도서관,한아름도서관,반달어린이도서관,사랑샘도서관,희망샘도서관,화홍어린이도서관,대추골도서관,한림도서관,창룡도서관,버드내도서관,광교홍재도서관,호매실도서관,일월도서관,화서다산도서관,광교푸른숲도서관,매여울도서관,망포글빛도서관)
96
84
 
97
85
  ## 마무리
98
86
 
@@ -103,8 +91,18 @@ Usage
103
91
  [![SPA for dongnelibrary](https://agvim.files.wordpress.com/2017/07/dongne23.png?w=128)](https://dongne.herokuapp.com/)
104
92
  [![APP for dongnelibrary](https://agvim.files.wordpress.com/2019/06/dlserver.png?w=128)](https://dlserver.herokuapp.com/app/)
105
93
 
94
+ ## Test
95
+
96
+ npm test
97
+ npm run dongne # 여러 도서관 검색
98
+ npm run gg # 경기도 도서관
99
+ npm run gunpo # 군포시 도서관
100
+ npm run hscity # 화성시 도서관
101
+ npm run osan # 오산시 도서관
102
+ npm run snlib # 성남시 도서관
103
+ npm run suwon # 수원시 도서관
104
+
106
105
  [dongnelibraryspa]: https://github.com/afrontend/dongnelibraryspa "AngularJS, Foundation을 사용한 Web UI"
107
- [hscity-url]: https://hscitylib.or.kr
108
106
  [npm-image]: https://img.shields.io/npm/v/dongnelibrary.svg
109
107
  [npm-url]: https://npmjs.org/package/dongnelibrary
110
108
  [travis-build-image]: https://travis-ci.org/afrontend/dongnelibrary.svg?branch=master
@@ -114,7 +112,9 @@ Usage
114
112
 
115
113
  [gg-url]: http://www.gglib.or.kr
116
114
  [gunpo-url]: http://www.gunpolib.go.kr
115
+ [hscity-url]: https://hscitylib.or.kr
117
116
  [osan-url]: http://www.osanlibrary.go.kr
118
- [sample-url]: https://npm.runkit.com/dongnelibrary
119
117
  [snlib-url]: http://www.snlib.net
120
118
  [suwon-url]: http://www.suwonlib.go.kr
119
+
120
+ [sample-url]: https://npm.runkit.com/dongnelibrary
package/aa.html ADDED
@@ -0,0 +1,27 @@
1
+ MA 남양
2
+ MB 태안
3
+ MC 삼괴
4
+ MD 병점
5
+ ME 샘내
6
+ MF 두빛나래
7
+ MG 봉담
8
+ MH 둥지나래
9
+ MI 목동이음터
10
+ MJ 기아행복마루
11
+ MK 동탄복합문화센터
12
+ ML 송산
13
+ MM 정남
14
+ MN 비봉
15
+ MO 진안
16
+ MP 중앙이음터
17
+ MQ 양감
18
+ MR 다원이음터
19
+ MS 송린이음터
20
+ MT 팔탄
21
+ MU 마도
22
+ MV 봉담커피앤북
23
+ MW 왕배푸른숲
24
+ MX 노을빛
25
+ MY 서연이음터
26
+ MZ 호연이음터
27
+ TA 늘봄이음터
package/docker/Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
1
  FROM alpine:3.6
2
2
 
3
- LABEL docker run --rm frontendwordpress/dongnelibrary dongnelibrary -l 여주도서관 -t 자바
3
+ LABEL docker run --rm frontendwordpress/dongnelibrary dongnelibrary -A -l 여주도서관 -t 자바
4
4
 
5
5
  RUN apk update && \
6
6
  apk add nodejs-npm && \
package/files.txt ADDED
@@ -0,0 +1,13 @@
1
+ ./src
2
+ ./src/dongnelibrary_util.js
3
+ ####./src/jquery.min.js
4
+ ./src/library
5
+ ./src/library/hscity.js
6
+ ./src/library/gg.js
7
+ ./src/library/suwon.js
8
+ ./src/library/snlib.js
9
+ ./src/library/gunpo.js
10
+ ./src/library/osan.js
11
+ ./src/dongnelibrary.js
12
+ ./src/example.js
13
+ ./src/dongnelibrary_cli.js
package/gg.sh ADDED
@@ -0,0 +1,43 @@
1
+ http GET 'https://www.osanlibrary.go.kr/kolaseek/plus/search/plusSearchResultList.do?searchType=SIMPLE&searchCategory=ALL&searchLibraryArr=MA&searchKey=ALL&searchKeyword=apple'
2
+
3
+ https://lib.goe.go.kr/gg/intro/search/index.do?menu_idx=10
4
+ viewPage=1
5
+ separateShelfCode=
6
+ facet_manage_code=
7
+ facet_author=
8
+ facet_publisher=
9
+ facet_pub_year=
10
+ facet_subject_code=
11
+ facet_media_code=
12
+ reSearchTitle=
13
+ reSearchAuthor=
14
+ reSearchPubler=
15
+ reSearchKeyword=
16
+ search_text=%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8
17
+ book_list=
18
+ title=
19
+ author=
20
+ publer=
21
+ keyword=
22
+ search_start_date=
23
+ search_end_date=
24
+ subjectCode=
25
+ booktype=BOOKANDNONBOOK
26
+ shelfCode=
27
+ libraryCodes=MA
28
+ _libraryCodes=on
29
+ _libraryCodes=on
30
+ _libraryCodes=on
31
+ _libraryCodes=on
32
+ _libraryCodes=on
33
+ _libraryCodes=on
34
+ _libraryCodes=on
35
+ _libraryCodes=on
36
+ _libraryCodes=on
37
+ _libraryCodes=on
38
+ _libraryCodes=on
39
+ sortField=NONE
40
+ sortType=ASC
41
+ rowCount=100#search_result
42
+
43
+ https://lib.goe.go.kr/gg/intro/search/index.do?menu_idx=10&viewPage=1&search_text=%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&booktype=BOOKANDNONBOOK&libraryCodes=MA&sortField=NONE&sortType=ASC&rowCount=1000#search_result
package/osan.rest ADDED
@@ -0,0 +1,127 @@
1
+ // Examples of some ElasticSearch requests.
2
+ #
3
+ # osan
4
+ https://www.osanlibrary.go.kr
5
+ POST /kolaseek/plus/search/plusSearchResultList.do
6
+ {
7
+ "searchType":"SIMPLE"
8
+ "searchCategory":"ALL"
9
+ "currentPageNo":"1"
10
+ "viewStatus":"IMAGE"
11
+ "preSearchKey":"ALL"
12
+ "preSearchKeyword":"javascript"
13
+ "searchKey":"ALL"
14
+ "searchKeyword":"javascript"
15
+ "searchLibraryArr":"MA"
16
+ "searchSort":"SIMILAR"
17
+ "searchOrder":"DESC"
18
+ "searchRecordCount":"10"
19
+ }
20
+
21
+ # https://www.osanlibrary.go.kr/kolaseek/plus/search/plusSearchResultList.do?searchType=SIMPLE&searchCategory=ALL&searchLibraryArr=MA&searchKey=ALL&searchKeyword=javascript
22
+ https://www.osanlibrary.go.kr
23
+ GET /kolaseek/plus/search/plusSearchResultList.do?searchType=SIMPLE&searchCategory=ALL&searchLibraryArr=MA&searchKey=ALL&searchKeyword=javascript&searchRecordCount=20
24
+
25
+ https://hscitylib.or.kr
26
+ GET /intro/menu/10008/program/30001/searchResultList.do?searchType=SIMPLE&searchManageCodeArr=MK&viewType=LIST&searchPubFormCode=ALL&currentPageNo=1&preSearchKeyword=javascript&searchKeyword=javascript&searchArticle=SCORE&searchOrder=ASC&searchDisplay=20&searchAggsFromPubYear=2003&searchAggsToPubYear=2022
27
+
28
+ https://hscitylib.or.kr/intro/menu/10008/program/30001/searchResultList.do?searchType=SIMPLE&searchManageCodeArr=${lcode}&viewType=LIST&searchPubFormCode=ALL&currentPageNo=1&preSearchKeyword=${etitle}&searchKeyword=${etitle}&searchArticle=SCORE&searchOrder=ASC&searchDisplay=1000
29
+ https://hscitylib.or.kr/intro/menu/10008/program/30001/searchResultList.do?searchType=SIMPLE&searchManageCodeArr=MA&viewType=LIST&searchPubFormCode=ALL&currentPageNo=1&preSearchKeyword=javascript&searchKeyword=javascript&searchArticle=SCORE&searchOrder=ASC&searchDisplay=1000
30
+
31
+ https://hscitylib.or.kr/intro/menu/10008/program/30001/searchResultList.do?searchType=SIMPLE&searchManageCodeArr=MK&searchKeyword=javascript
32
+
33
+
34
+ https://www.gunpolib.go.kr
35
+ GET /pyxis-api/1/collections/1/search?all=k%7Ca%7Cjavascript&abc=&max=1000&offset=0&rq=
36
+
37
+
38
+ #
39
+ # View nodes status
40
+ #
41
+ http://localhost:9200
42
+ GET /_cat/nodes?v
43
+
44
+ #
45
+ # Add a new doc to the new 'testindex' and 'testtype'
46
+ #
47
+ http://localhost:9200
48
+
49
+ POST /testindex/testtype
50
+ {
51
+ "name": "some name",
52
+ "value": "some value",
53
+ "date": "2015-01-01"
54
+ }
55
+
56
+ #
57
+ # Search 'testindex'
58
+ #
59
+ http://localhost:9200
60
+ GET /testindex/_search?pretty
61
+
62
+ #
63
+ # View mapping.
64
+ #
65
+ http://localhost:9200
66
+ GET /testindex/testtype/_mapping?pretty
67
+
68
+ #
69
+ # Bulk-add new docs to 'testindex' using an external data file.
70
+ #
71
+ http://localhost:9200
72
+
73
+ POST /testindex/_bulk?pretty
74
+ @data.sample.json
75
+
76
+ #
77
+ # Lite search
78
+ #
79
+ http://localhost:9200
80
+ GET /testindex/testtype/_search?pretty
81
+ q=+name:FOO +value:(FOO BAR)
82
+
83
+ # or
84
+ http://localhost:9200
85
+ GET /testindex/testtype/_search
86
+ pretty&
87
+ q=+name:FOO +value:(FOO BAR)
88
+
89
+ #
90
+ # Full-body search
91
+ #
92
+ http://localhost:9200
93
+
94
+ POST /testindex/_search?pretty
95
+ {
96
+ "query": {
97
+ "filtered": {
98
+ "filter": {
99
+ "range": {
100
+ "date": {
101
+ "gte": "2015-01-06",
102
+ "lte": "2015-01-08"
103
+ }
104
+ }
105
+ },
106
+ "query": {
107
+ "match": {
108
+ "value": "FOO"
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+
115
+ #
116
+ # Delete 'testindex'
117
+ #
118
+ http://localhost:9200
119
+ DELETE /testindex?pretty
120
+
121
+ #
122
+ # Check for 'testindex' existence
123
+ #
124
+ http://localhost:9200
125
+ HEAD /testindex
126
+
127
+
package/osan.sh ADDED
@@ -0,0 +1,3 @@
1
+ http POST https://www.osanlibrary.go.kr/kolaseek/plus/search/plusSearchResultList.do \
2
+
3
+
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "dongnelibrary",
3
3
  "engines": {
4
- "node": ">=8.0.0"
4
+ "node": ">=16.0.0"
5
5
  },
6
- "version": "0.1.21",
6
+ "version": "0.2.0",
7
7
  "description": "책을 빌릴 수 있는지 확인한다.",
8
8
  "main": "src/dongnelibrary.js",
9
9
  "bin": {
@@ -16,7 +16,8 @@
16
16
  "gunpo": "mocha test/gunpo.spec.js",
17
17
  "hscity": "mocha test/hscity.spec.js",
18
18
  "osan": "mocha test/osan.spec.js",
19
- "snlib": "mocha test/snlib.spec.js"
19
+ "snlib": "mocha test/snlib.spec.js",
20
+ "suwon": "mocha test/suwon.spec.js"
20
21
  },
21
22
  "repository": {
22
23
  "type": "git",
@@ -39,20 +40,21 @@
39
40
  },
40
41
  "homepage": "https://github.com/afrontend/dongnelibrary#readme",
41
42
  "devDependencies": {
42
- "mocha": "^5.2.0",
43
+ "acorn": ">=5.7.4",
43
44
  "minimist": ">=1.2.2",
44
- "acorn": ">=5.7.4"
45
+ "mocha": "^10.2.0"
45
46
  },
46
47
  "tonicExampleFilename": "src/example.js",
47
48
  "dependencies": {
48
49
  "async": "^2.5.0",
49
- "colors": "^1.1.2",
50
+ "colors": "^1.4.0",
50
51
  "commander": "^2.11.0",
51
52
  "configstore": "^4.0.0",
52
53
  "figlet": "^1.2.1",
53
54
  "inquirer": "^6.2.2",
54
- "jsdom": "^9.4.1",
55
- "lodash": ">=4.17.13",
55
+ "jquery": "^3.6.4",
56
+ "jsdom": "^21.1.1",
57
+ "lodash": "^4.17.20",
56
58
  "request": "^2.73.0"
57
59
  }
58
60
  }
@@ -5,6 +5,7 @@ const gunpo = require('./library/gunpo');
5
5
  const hscity = require('./library/hscity');
6
6
  const osan = require('./library/osan');
7
7
  const snlib = require('./library/snlib');
8
+ const suwon = require('./library/suwon');
8
9
  const async = require('async');
9
10
  const util = require('./dongnelibrary_util.js');
10
11
 
@@ -18,7 +19,8 @@ function makeLibraryList() {
18
19
  gunpo,
19
20
  hscity,
20
21
  osan,
21
- snlib
22
+ snlib,
23
+ suwon
22
24
  ];
23
25
 
24
26
  _.each(library, library => {
@@ -27,7 +27,7 @@ const introMessage = (msg) => {
27
27
  program
28
28
  .version(pkg.version)
29
29
  .option('-a, --library-list', 'display libraries')
30
- .option('-i, --interactive', 'interactive mode')
30
+ .option('-A, --all', 'use -l, -t')
31
31
  .option('-l, --library-name [name,name]', 'library name')
32
32
  .option('-t, --title [title]', 'book title')
33
33
  .parse(process.argv);
@@ -125,7 +125,9 @@ function activate(option) {
125
125
  return;
126
126
  }
127
127
 
128
- if (option.interactive) {
128
+ if (option.all) {
129
+ search(option, processOneLibrary, processLibraries);
130
+ } else {
129
131
  introMessage('Dongne Library');
130
132
  inquirer
131
133
  .prompt([
@@ -152,10 +154,7 @@ function activate(option) {
152
154
  search(option, processOneLibrary, processLibraries);
153
155
  }
154
156
  });
155
- } else {
156
- search(option, processOneLibrary, processLibraries);
157
157
  }
158
-
159
158
  }
160
159
 
161
160
  activate(program);