hellowhales

APIhandelr Alpha version

1 let request = require('request'); 1 let request = require('request');
2 let options = { 2 let options = {
3 'method': 'GET', 3 'method': 'GET',
4 - 'url': 'http://api.visitkorea.or.kr/openapi/service/rest/KorService/areaBasedList?ServiceKey=2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dAw%3D%3D&contentTypeId=15&areaCode=&sigunguCode=&cat1=&cat2=&cat3=&listYN=Y&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&arrange=C&numOfRows=12&pageNo=1&_type=json', 4 + 'url': 'http://api.visitkorea.or.kr/openapi/service/rest/KorService/areaBasedList?ServiceKey=3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPSw%3D%3D&contentTypeId=15&areaCode=&sigunguCode=&cat1=&cat2=&cat3=&listYN=Y&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&arrange=C&numOfRows=12&pageNo=1&_type=json',
5 'headers': { 5 'headers': {
6 } 6 }
7 }; 7 };
...@@ -18,7 +18,7 @@ for(i in info['response']['body']['items']['item']){ ...@@ -18,7 +18,7 @@ for(i in info['response']['body']['items']['item']){
18 'public': { 18 'public': {
19 'method': 'GET', 19 'method': 'GET',
20 'url': 'http://api.visitkorea.or.kr/openapi/service/rest/KorService/detailCommon?' 20 'url': 'http://api.visitkorea.or.kr/openapi/service/rest/KorService/detailCommon?'
21 - + 'ServiceKey=' + '2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dAw%3D%3D' 21 + + 'ServiceKey=' + '3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPSw%3D%3D'
22 + '&contentTypeId=' + '15' 22 + '&contentTypeId=' + '15'
23 + '&contentId=' + +contentId[i] 23 + '&contentId=' + +contentId[i]
24 + '&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&defaultYN=Y&firstImageYN=Y&areacodeYN=Y&catcodeYN=Y&addrinfoYN=Y&mapinfoYN=Y&overviewYN=Y&transGuideYN=Y&_type=json', 24 + '&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&defaultYN=Y&firstImageYN=Y&areacodeYN=Y&catcodeYN=Y&addrinfoYN=Y&mapinfoYN=Y&overviewYN=Y&transGuideYN=Y&_type=json',
...@@ -27,7 +27,7 @@ for(i in info['response']['body']['items']['item']){ ...@@ -27,7 +27,7 @@ for(i in info['response']['body']['items']['item']){
27 'detail': { 27 'detail': {
28 'method': 'GET', 28 'method': 'GET',
29 'url': 'http://api.visitkorea.or.kr/openapi/service/rest/KorService/detailIntro?' 29 'url': 'http://api.visitkorea.or.kr/openapi/service/rest/KorService/detailIntro?'
30 - + 'ServiceKey=' + '2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dAw%3D%3D' 30 + + 'ServiceKey=' + '3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPSw%3D%3D'
31 + '&contentTypeId=' + '15' 31 + '&contentTypeId=' + '15'
32 + '&contentId=' + contentId[i] 32 + '&contentId=' + contentId[i]
33 + '&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&introYN=Y&_type=json', 33 + '&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&introYN=Y&_type=json',
...@@ -36,7 +36,7 @@ for(i in info['response']['body']['items']['item']){ ...@@ -36,7 +36,7 @@ for(i in info['response']['body']['items']['item']){
36 'weather': { 36 'weather': {
37 'method': 'GET', 37 'method': 'GET',
38 'url': 'http://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getVilageFcst?' 38 'url': 'http://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getVilageFcst?'
39 - + 'serviceKey=' + '2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dAw%3D%3D' 39 + + 'serviceKey=' + '3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPSw%3D%3D'
40 + '&pageNo=' + '1' 40 + '&pageNo=' + '1'
41 + '&numOfRows=' + '50' 41 + '&numOfRows=' + '50'
42 + '&dataType=' + 'JSON' 42 + '&dataType=' + 'JSON'
......
...@@ -6,12 +6,25 @@ const festivalSchema = new Schema({ ...@@ -6,12 +6,25 @@ const festivalSchema = new Schema({
6 addr: String, 6 addr: String,
7 tel: String, 7 tel: String,
8 mapx : Number, 8 mapx : Number,
9 - mapy : Number 9 + mapy : Number,
10 + eventstartdate : String,
11 + eventenddate : String,
12 + overview : String,
13 + firstimage : String,
14 + homepage : String,
15 + district : String,
16 + city : String,
17 + temparature : Number,
18 + weathers : String
19 + // weather : {
20 + // date1: { weather : String, temp : Number},
21 + // date2: { weather : String, temp : Number},
22 + // date3: { weather : String, temp : Number},
23 + // }
10 }, 24 },
11 { 25 {
12 - timestamps: true 26 + versionKey: false
13 -} 27 +});
14 -);
15 28
16 29
17 module.exports = mongoose.model('Festival',festivalSchema); 30 module.exports = mongoose.model('Festival',festivalSchema);
......
This diff is collapsed. Click to expand it.