{"action":"created","issue":{"url":"https://api.github.com/repos/WizardFactory/BlogSyncer/issues/186","labels_url":"https://api.github.com/repos/WizardFactory/BlogSyncer/issues/186/labels{/name}","comments_url":"https://api.github.com/repos/WizardFactory/BlogSyncer/issues/186/comments","events_url":"https://api.github.com/repos/WizardFactory/BlogSyncer/issues/186/events","html_url":"https://github.com/WizardFactory/BlogSyncer/issues/186","id":67973906,"number":186,"title":"JUS-126 tumblr link post를 tumblr에 text post할 때 죽는 문제.","user":{"login":"kimalec","id":6895272,"avatar_url":"https://avatars.githubusercontent.com/u/6895272?v=3","gravatar_id":"","url":"https://api.github.com/users/kimalec","html_url":"https://github.com/kimalec","followers_url":"https://api.github.com/users/kimalec/followers","following_url":"https://api.github.com/users/kimalec/following{/other_user}","gists_url":"https://api.github.com/users/kimalec/gists{/gist_id}","starred_url":"https://api.github.com/users/kimalec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimalec/subscriptions","organizations_url":"https://api.github.com/users/kimalec/orgs","repos_url":"https://api.github.com/users/kimalec/repos","events_url":"https://api.github.com/users/kimalec/events{/privacy}","received_events_url":"https://api.github.com/users/kimalec/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-12T23:41:27Z","updated_at":"2015-04-27T01:29:50Z","closed_at":"2015-04-23T13:28:30Z","body":"사용자가 tumblr에 link post를 하면, 그것을 text로 다른 tumblr blog에 post하면 죽는 문제가 발생함.\r\n\r\n![2015-04-13 08 17 39](https://cloud.githubusercontent.com/assets/6895272/7340402/fe3d2608-ecc7-11e4-9af5-01c9c71758fc.png)\r\n"},"comment":{"url":"https://api.github.com/repos/WizardFactory/BlogSyncer/issues/comments/96458112","html_url":"https://github.com/WizardFactory/BlogSyncer/issues/186#issuecomment-96458112","issue_url":"https://api.github.com/repos/WizardFactory/BlogSyncer/issues/186","id":96458112,"user":{"login":"kimalec","id":6895272,"avatar_url":"https://avatars.githubusercontent.com/u/6895272?v=3","gravatar_id":"","url":"https://api.github.com/users/kimalec","html_url":"https://github.com/kimalec","followers_url":"https://api.github.com/users/kimalec/followers","following_url":"https://api.github.com/users/kimalec/following{/other_user}","gists_url":"https://api.github.com/users/kimalec/gists{/gist_id}","starred_url":"https://api.github.com/users/kimalec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimalec/subscriptions","organizations_url":"https://api.github.com/users/kimalec/orgs","repos_url":"https://api.github.com/users/kimalec/repos","events_url":"https://api.github.com/users/kimalec/events{/privacy}","received_events_url":"https://api.github.com/users/kimalec/received_events","type":"User","site_admin":false},"created_at":"2015-04-27T01:29:50Z","updated_at":"2015-04-27T01:29:50Z","body":"Alec Kim added a comment - 13/Apr/15 8:56 AM\r\n그림이 없는 경우에는 죽지는 않지만 정보를 제대로 표시하지 못함.\r\nlink post의 경우에는 link를 지원하는 provider의 경우에는 link로 전달하는 것이 맞을 것으로 보임.\r\n그렇다면, post(text)만 지원하는 경우에 방법 모색이 필요함.\r\n![2015-04-13 08 55 07](https://cloud.githubusercontent.com/assets/6895272/7340411/1d0a67d0-ecc8-11e4-9582-dd91ba2bdabf.png)\r\n\r\n의 경우에는 코드 상에 문제가 있었음.\r\npost해야할 글의 type이 link이면 아래의 코드에 의해서 내용이 변경되어 들어감.\r\n``` javascript\r\n case \"link\":\r\n                send_post.title = raw_post.title;\r\n                if (is_body) {\r\n                    send_post.content = \"url : \"+raw_post.url+\" description : \" + raw_post.description;\r\n                }\r\n```\r\n\r\nAlec Kim added a comment - 4 days ago\r\n아래와 비슷한 메세지가 나옴.\r\n```\r\n/Users/aleckim/WebstormProjects/BlogSyncer/node_modules/tumblr.js/lib/tumblr.js:212\r\n    if (options[choices[i]]) {\r\n               ^\r\nTypeError: Cannot read property 'body' of undefined\r\n    at requireValidation (/Users/aleckim/WebstormProjects/BlogSyncer/node_modules/tumblr.js/lib/tumblr.js:212:16)\r\n    at new <anonymous> (/Users/aleckim/WebstormProjects/BlogSyncer/node_modules/tumblr.js/lib/tumblr.js:30:7)\r\n    at /Users/aleckim/WebstormProjects/BlogSyncer/routes/tumblr.js:539:24\r\n    at Promise.<anonymous> (/Users/aleckim/WebstormProjects/BlogSyncer/controllers/userManager.js:227:9)\r\n```\r\n\r\nAlec Kim added a comment - 4 days ago\r\n``` javascript\r\nvar postFunc;\r\n        if (postType === \"post\") {\r\n            postFunc = client.text;\r\n        }\r\n        else if (postType === \"link\") {\r\n            postFunc = client.link;\r\n        }\r\n        else {\r\n            //need to refactoring make a error object;\r\n            var error = new Error(\"postType was undefined\");\r\n            log.error(error, meta);\r\n            return res.status(500).send(error);\r\n        }\r\n        postFunc(blog_id, options, function (error, response) {\r\n```\r\n위와 같이 하면 아래의 부분에서 _post를 찾지 못함.\r\n``` javascript\r\n  postCreation: function (type, requireOptions, acceptsData) {\r\n    return function (blogName, options, callback) {\r\n      requireValidation(options, requireOptions);\r\n      options.type = type;\r\n      if (!acceptsData) {\r\n        delete options.data;\r\n      }\r\n      this._post(blogPath(blogName, '/post'), options, callback);\r\n    };\r\n  },\r\n```"}}