Seokjin

[UPDATE]weather/tommorrow

......@@ -106,6 +106,8 @@ if(today.getDate()<10){
base=CurDay+"0"+(today.getDate()-1).toString();
tommorow=CurDay+"0"+(today.getDate()+1).toString();
CurDay+="0"+today.getDate().toString();
}
else{
......@@ -150,7 +152,7 @@ app.post('/api/weather',(req,res)=>{
queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('1000'); /* */
queryParams += '&' + encodeURIComponent('dataType') + '=' + encodeURIComponent('JSON'); /* */
queryParams += '&' + encodeURIComponent('base_date') + '=' + encodeURIComponent(base); /* */
queryParams += '&' + encodeURIComponent('base_time') + '=' + encodeURIComponent('2300'); /* */
queryParams += '&' + encodeURIComponent('base_time') + '=' + encodeURIComponent('2359'); /* */
queryParams += '&' + encodeURIComponent('nx') + '=' + encodeURIComponent(nx); /*nx*/
queryParams += '&' + encodeURIComponent('ny') + '=' + encodeURIComponent(ny); /*ny*/
request({
......@@ -204,11 +206,12 @@ app.post('/api/tommorrow',(req,res)=>{
var url = 'http://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getVilageFcst';
const nx = req.body.dotX;
const ny = req.body.dotY;
queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('1'); /* */
queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('1000'); /* */
queryParams += '&' + encodeURIComponent('dataType') + '=' + encodeURIComponent('JSON'); /* */
queryParams += '&' + encodeURIComponent('base_date') + '=' + encodeURIComponent(CurDay); /* */
queryParams += '&' + encodeURIComponent('base_time') + '=' + encodeURIComponent('0200'); /* */
queryParams += '&' + encodeURIComponent('base_date') + '=' + encodeURIComponent(base); /* */
queryParams += '&' + encodeURIComponent('base_time') + '=' + encodeURIComponent('2359'); /* */
queryParams += '&' + encodeURIComponent('nx') + '=' + encodeURIComponent(nx); /*nx*/
queryParams += '&' + encodeURIComponent('ny') + '=' + encodeURIComponent(ny); /*ny*/
request({
......@@ -219,6 +222,7 @@ app.post('/api/tommorrow',(req,res)=>{
let item=ex.response.body.items.item;
let i=0;
let a=[];//, a4=[], a5=[], a6=[], a7=[], a8=[], a9=[], a10=[], a11=[], a12=[], a13=[], a14=[], a15=[], a16=[], a17=[], a18=[], a19=[], a20=[], a21=[], a22=[], a23=[];
while(item[i].fcstDate==tommorow||item[i].fcstDate==CurDay){
if((item[i].category=='POP' || item[i].category=='TMP') && item[i].fcstDate==tommorow){
a.push(item[i]);
......
let today=new Date();
console.log(typeof(today.getHours()));
\ No newline at end of file