Toggle navigation
Toggle navigation
This project
Loading...
Sign in
임승현
/
Multiplex_Ticketing_Platform
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
ShinSeungMin
2022-05-16 00:34:21 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
528c75baeda265ddd9ba2406d3831a4830a6ead5
528c75ba
1 parent
2b3e19ce
Add testing BoxOffice API
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
BoxOffice/app.js
BoxOffice/package.json
BoxOffice/app.js
0 → 100644
View file @
528c75b
let
express
=
require
(
'express'
);
let
app
=
express
();
let
request
=
require
(
'request'
);
let
bodyParser
=
require
(
'body-parser'
);
const
{
response
}
=
require
(
'express'
);
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}));
app
.
use
(
bodyParser
.
json
());
let
today
=
new
Date
();
let
year
=
today
.
getFullYear
();
let
month
=
(
"0"
+
(
1
+
today
.
getMonth
())).
slice
(
-
2
);
let
day
=
(
"0"
+
today
.
getDate
()).
slice
(
-
2
);
let
date
=
year
+
month
+
day
-
1
;
//YYYYMMDD
//console.log(date);
let
key
=
"b70513efc156d7b826bb8dc98ff2f1cf"
;
let
url
=
"http://kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key="
+
key
+
"&targetDt="
;
let
rank
=
5
// apiurl = url + date + "&itemPerPage=" +rank-> "출력할 박스오피스 순위(5: 5위 까지, 10 : 10위 까지.../기본, 최대 10)"
//console.log(url);
let
options
=
{
'method'
:
'GET'
,
'url'
:
url
+
date
+
"&itemPerPage="
+
rank
};
request
(
options
,
function
(
error
,
response
,
body
){
if
(
error
){
throw
new
Error
(
error
);
}
let
info
=
JSON
.
parse
(
body
);
console
.
log
(
info
);
});
// 박스오피스 순위 출력
let
server
=
app
.
listen
(
80
);
\ No newline at end of file
BoxOffice/package.json
0 → 100644
View file @
528c75b
{
"name"
:
"Testing BoxOffice API"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"author"
:
""
,
"license"
:
"ISC"
,
"dependencies"
:
{
"body-parser"
:
"^1.17.1"
,
"express"
:
"^4.15.2"
}
}
\ No newline at end of file
Please
register
or
login
to post a comment