Closed neoqmin closed 8 years ago
tistory.js(ln:182)
var item = JSON.parse(body).tistory.item; // 블로그가 하나일 경우 item.length가 undefined입니다. log.debug('item length=' + item.length, meta); // 아래에서 botBlogList에 botBlog를 추가히지 못합니다. for (var i = 0; i < item.length; i+=1) { {생략} var botBlog = new botFormat.BotBlog(target_url, item[i].title, item[i].url); botBlogList.blogs.push(botBlog); }
아 tistory에서는 object가 여러개면 arrary로 보내고, 하나면 array 만들지 않고 바로 object 실어서 그런거 같아
그래서 item.length가 undefined일 경우 item[0]에 JSON.parse(body).tistory.item를 대입하는 방법을 사용할까합니다.
tistory에 블로그가 하나밖에 없을 경우 아래의 코드에서 오류가 발생합니다.
tistory.js(ln:182)