Seokjin

[UPDATE]weather/tommorrow

...@@ -106,6 +106,8 @@ if(today.getDate()<10){ ...@@ -106,6 +106,8 @@ if(today.getDate()<10){
106 base=CurDay+"0"+(today.getDate()-1).toString(); 106 base=CurDay+"0"+(today.getDate()-1).toString();
107 tommorow=CurDay+"0"+(today.getDate()+1).toString(); 107 tommorow=CurDay+"0"+(today.getDate()+1).toString();
108 108
109 +
110 +
109 CurDay+="0"+today.getDate().toString(); 111 CurDay+="0"+today.getDate().toString();
110 } 112 }
111 else{ 113 else{
...@@ -150,7 +152,7 @@ app.post('/api/weather',(req,res)=>{ ...@@ -150,7 +152,7 @@ app.post('/api/weather',(req,res)=>{
150 queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('1000'); /* */ 152 queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('1000'); /* */
151 queryParams += '&' + encodeURIComponent('dataType') + '=' + encodeURIComponent('JSON'); /* */ 153 queryParams += '&' + encodeURIComponent('dataType') + '=' + encodeURIComponent('JSON'); /* */
152 queryParams += '&' + encodeURIComponent('base_date') + '=' + encodeURIComponent(base); /* */ 154 queryParams += '&' + encodeURIComponent('base_date') + '=' + encodeURIComponent(base); /* */
153 - queryParams += '&' + encodeURIComponent('base_time') + '=' + encodeURIComponent('2300'); /* */ 155 + queryParams += '&' + encodeURIComponent('base_time') + '=' + encodeURIComponent('2359'); /* */
154 queryParams += '&' + encodeURIComponent('nx') + '=' + encodeURIComponent(nx); /*nx*/ 156 queryParams += '&' + encodeURIComponent('nx') + '=' + encodeURIComponent(nx); /*nx*/
155 queryParams += '&' + encodeURIComponent('ny') + '=' + encodeURIComponent(ny); /*ny*/ 157 queryParams += '&' + encodeURIComponent('ny') + '=' + encodeURIComponent(ny); /*ny*/
156 request({ 158 request({
...@@ -204,11 +206,12 @@ app.post('/api/tommorrow',(req,res)=>{ ...@@ -204,11 +206,12 @@ app.post('/api/tommorrow',(req,res)=>{
204 var url = 'http://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getVilageFcst'; 206 var url = 'http://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getVilageFcst';
205 const nx = req.body.dotX; 207 const nx = req.body.dotX;
206 const ny = req.body.dotY; 208 const ny = req.body.dotY;
209 +
207 queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('1'); /* */ 210 queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('1'); /* */
208 queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('1000'); /* */ 211 queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('1000'); /* */
209 queryParams += '&' + encodeURIComponent('dataType') + '=' + encodeURIComponent('JSON'); /* */ 212 queryParams += '&' + encodeURIComponent('dataType') + '=' + encodeURIComponent('JSON'); /* */
210 - queryParams += '&' + encodeURIComponent('base_date') + '=' + encodeURIComponent(CurDay); /* */ 213 + queryParams += '&' + encodeURIComponent('base_date') + '=' + encodeURIComponent(base); /* */
211 - queryParams += '&' + encodeURIComponent('base_time') + '=' + encodeURIComponent('0200'); /* */ 214 + queryParams += '&' + encodeURIComponent('base_time') + '=' + encodeURIComponent('2359'); /* */
212 queryParams += '&' + encodeURIComponent('nx') + '=' + encodeURIComponent(nx); /*nx*/ 215 queryParams += '&' + encodeURIComponent('nx') + '=' + encodeURIComponent(nx); /*nx*/
213 queryParams += '&' + encodeURIComponent('ny') + '=' + encodeURIComponent(ny); /*ny*/ 216 queryParams += '&' + encodeURIComponent('ny') + '=' + encodeURIComponent(ny); /*ny*/
214 request({ 217 request({
...@@ -219,6 +222,7 @@ app.post('/api/tommorrow',(req,res)=>{ ...@@ -219,6 +222,7 @@ app.post('/api/tommorrow',(req,res)=>{
219 let item=ex.response.body.items.item; 222 let item=ex.response.body.items.item;
220 let i=0; 223 let i=0;
221 let a=[];//, a4=[], a5=[], a6=[], a7=[], a8=[], a9=[], a10=[], a11=[], a12=[], a13=[], a14=[], a15=[], a16=[], a17=[], a18=[], a19=[], a20=[], a21=[], a22=[], a23=[]; 224 let a=[];//, a4=[], a5=[], a6=[], a7=[], a8=[], a9=[], a10=[], a11=[], a12=[], a13=[], a14=[], a15=[], a16=[], a17=[], a18=[], a19=[], a20=[], a21=[], a22=[], a23=[];
225 +
222 while(item[i].fcstDate==tommorow||item[i].fcstDate==CurDay){ 226 while(item[i].fcstDate==tommorow||item[i].fcstDate==CurDay){
223 if((item[i].category=='POP' || item[i].category=='TMP') && item[i].fcstDate==tommorow){ 227 if((item[i].category=='POP' || item[i].category=='TMP') && item[i].fcstDate==tommorow){
224 a.push(item[i]); 228 a.push(item[i]);
......
1 +let today=new Date();
2 +console.log(typeof(today.getHours()));
...\ No newline at end of file ...\ No newline at end of file