[Steemit javascript api 사용하기 레슨8] 블로그에 포스팅하기

안녕하세요 @fullmi입니다.

오늘은 글을 등록하는 api를 사용해서 steemit에 포스팅 해볼건데요

오늘은 steem-js를 사용해 보겠습니다. steemit api문서에서 제가 못찾아서요

그럼 일단 

위의 스크립트를 삽입해 주시고요.

아래와 같이 작성해주면 끝입니다.

<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>포스팅 작성하기</title>
<script>

function fn_write() {
/** Configure your account */
var username = 'fullmi';
var postingWif = '개인포스팅키입니다.';


try {
/** Broadcast a post */
var permlink = new Date().toISOString().replace(/[^a-zA-Z0-9]+/g, '').toLowerCase();
steem.broadcast.comment(
postingWif,
'', // 공백으로 남김니다.
'kr', // 메인테그를 적습니다.
username, // 계정을 적습니다.
permlink + '-post', // Permlink를 임의로 생성해 줍니다.
'타이틀입니다.', // Title
'내용부분입니다.', // Body
{ tags: ['kr', 'jjangjjangman'], app: 'busy' }, // Json Metadata
function (err, result) {
if (err)
$('#content').html(JSON.stringify(err));
else {
alert('작성했습니다.');
// location.href = '/Post/GoStop/Comment?p='+permlink + '-post';
$('#content').html(JSON.stringify(result));
}
}
);
} catch (e) {
console.log(e);
}
}
</script>
</head>

<body>
<div id="content"></div>
<button onclick="fn_write()" >작성하기</button>
</body>

</html>
H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now