
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
티스토리 오픈 API 래퍼입니다.
npm install --save tistory
const http = require('http')
const url = require('url')
const Tistory = require('tistory')
http.createServer(async function (req, res) {
const tistory = new Tistory()
const code = url.parse(req.url, true).query.code
if (code) {
await tistory.setAccessToken('__APP_ID__', '__SECRET_KEY__', '__CALLBACK__', code)
// 요청 ...
} else {
res.writeHead(302, {
Location: tistory.getPermissionUrl('__APP_ID__', '__CALLBACK__', 'code')
})
}
res.end()
}).listen(8080)
tistory.getPermissionUrl() 를 사용하면 인증을 위한 티스토리 주소를 얻어올 수 있습니다. 사용자가 허용을 하면, 설정한 __CALLBACK__ 으로 리다이렉트되면서 code 값이 GET 파라매터로 넘어오게 됩니다. tistory.setAccessToken() 으로 내부적으로 엑세스 토큰을 설정합니다.
티스토리에 요청하려면 tistory.get(), tistory.post() 을 사용합니다. 요청 주소가 https://www.tistory.com/apis/blog/info 인 경우, https://www.tistory.com/apis/ 를 제외한 blog/info 를 매개변수로 하여 요청을 보낼 수 있습니다.
티스토리 오픈 API 에서 GET 요청시에는 item 프로퍼티가 존재합니다.
// GET https://www.tistory.com/apis/blog/info
const { data } = await tistory.get('blog/info')
for (const blog of data.tistory.item.blogs) {
//
}
요청 시에는 추가 매개변수가 필요할 수도 있습니다. 또한 POST 요청에는 item 프로퍼티가 포함되지 않습니다.
const { data } = await tistory.post('post/write', {
blogName: 'pronist',
title: 'Hello, world',
visibility: 0
})
console.log(data.tistory.url)
파일을 첨부하려면 단순히 fs.createReadStream() 으로 넘겨줄 수 있습니다. 티스토리 제약으로 인해 이미지만 가능합니다.
const fs = require('fs')
// GET https://www.tistory.com/apis/post/attach
const { data } = await tistory.post('post/attach', {
blogName: 'pronist',
uploadedfile: fs.createReadStream('path/to/file.png')
})
Copyright 2018-2020. SangWoo Jeong. All rights reserved.
FAQs
Javascript Tistory API package, Support Node.js, and Browser
We found that tistory demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.