We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
naver에서 제공하는 글쓰기 api 적용
http://developer.naver.com/wiki/pages/NaverBlogAPI
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
router.post('/bot_posts/new/:blog_id', function (req, res) { var userId = userMgr.getUserId(req, res); if (!userId) { return; } var meta = {"cName":NAVER_PROVIDER, "userId":userId, "url":req.url}; log.info("+", meta); var blogId = req.params.blog_id; var botPost = req.body; var newForm = new formData(); log.info('image path :' + __dirname + '/naver.png'); newForm.append('image', fs.createReadStream(__dirname + '/naver.png')); var testData = '<div>Hello world This is image example. <img src="#0" />Fig. 1-1Good day! </div>'; newForm.append('contents', testData); newForm.append('title', 'TEST Image'); userMgr.findProviderByUserId(userId, NAVER_PROVIDER, blogId, function (err, user, provider) { var apiUrl = NAVER_API_URL + "/writePost.json"; log.debug(apiUrl, meta); newForm.getLength(function(err, length){ log.info('content length : ' + length); var req = request.post(apiUrl, { json: true, multipart: true, headers: { "Authorization": "Bearer " + provider.accessToken, } }, function (err, response, body) { if(err) { log.info('post ERROR!!!!'); return; } log.info('posted'); }); req._form = newForm; //req.setHeader('content-length', length); //req.setHeader('enctype', 'multipart/form-data'); //req.setHeader('content-type', 'image/jpeg'); }); }); });
pokers
No branches or pull requests
naver에서 제공하는 글쓰기 api 적용
http://developer.naver.com/wiki/pages/NaverBlogAPI
The text was updated successfully, but these errors were encountered: