hellowhales

APIhandelr Alpha version

let request = require('request');
let options = {
'method': 'GET',
'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',
'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',
'headers': {
}
};
......@@ -18,7 +18,7 @@ for(i in info['response']['body']['items']['item']){
'public': {
'method': 'GET',
'url': 'http://api.visitkorea.or.kr/openapi/service/rest/KorService/detailCommon?'
+ 'ServiceKey=' + '2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dAw%3D%3D'
+ 'ServiceKey=' + '3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPSw%3D%3D'
+ '&contentTypeId=' + '15'
+ '&contentId=' + +contentId[i]
+ '&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']){
'detail': {
'method': 'GET',
'url': 'http://api.visitkorea.or.kr/openapi/service/rest/KorService/detailIntro?'
+ 'ServiceKey=' + '2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dAw%3D%3D'
+ 'ServiceKey=' + '3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPSw%3D%3D'
+ '&contentTypeId=' + '15'
+ '&contentId=' + contentId[i]
+ '&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&introYN=Y&_type=json',
......@@ -36,7 +36,7 @@ for(i in info['response']['body']['items']['item']){
'weather': {
'method': 'GET',
'url': 'http://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getVilageFcst?'
+ 'serviceKey=' + '2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dAw%3D%3D'
+ 'serviceKey=' + '3zrQDvoNwUV9Se%2BHZv8DjCCNWRGJisQ7jjHP6LsbJqoRQ2cJpQKrHUGC4uslgXSVO9Dzb06BSC3kp9BunvIPSw%3D%3D'
+ '&pageNo=' + '1'
+ '&numOfRows=' + '50'
+ '&dataType=' + 'JSON'
......
......@@ -6,12 +6,25 @@ const festivalSchema = new Schema({
addr: String,
tel: String,
mapx : Number,
mapy : Number
mapy : Number,
eventstartdate : String,
eventenddate : String,
overview : String,
firstimage : String,
homepage : String,
district : String,
city : String,
temparature : Number,
weathers : String
// weather : {
// date1: { weather : String, temp : Number},
// date2: { weather : String, temp : Number},
// date3: { weather : String, temp : Number},
// }
},
{
timestamps: true
}
);
versionKey: false
});
module.exports = mongoose.model('Festival',festivalSchema);
......
This diff is collapsed. Click to expand it.