Skip to content
Snippets Groups Projects
Commit 04fc58e5 authored by adcpm's avatar adcpm
Browse files

Add follow / unfollow examples

parent 361a172d
No related branches found
No related tags found
No related merge requests found
...@@ -34,8 +34,51 @@ ...@@ -34,8 +34,51 @@
username, // Author username, // Author
permlink, // Permlink permlink, // Permlink
'', // Title '', // Title
'This is a test!', // Body, 'This is a test!', // Body
{ tags: ['test'], app: `steemjs/examples` }, // Json Metadata { tags: ['test'], app: 'steemjs/examples' }, // Json Metadata
function(err, result) {
console.log(err, result);
}
);
/** Follow an user */
var follower = username; // Your username
var following = 'steemjs'; // User to follow
var json = JSON.stringify(
['follow', {
follower: follower,
following: following,
what: ['blog']
}]
);
steem.broadcast.customJson(
postingWif,
[], // Required_auths
[follower], // Required Posting Auths
'follow', // Id
json, //
function(err, result) {
console.log(err, result);
}
);
/** Unfollow an user */
var json = JSON.stringify(
['follow', {
follower: follower,
following: following,
what: []
}]
);
steem.broadcast.customJson(
postingWif,
[], // Required_auths
[follower], // Required Posting Auths
'follow', // Id
json, //
function(err, result) { function(err, result) {
console.log(err, result); console.log(err, result);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment