diff --git a/examples/broadcast.html b/examples/broadcast.html index 9c6a8d51b9b0e1e01e73a0bba956805b1ac9bbf0..3d4464b91f164a86fc1441c2bcaf18f9c2584ae3 100644 --- a/examples/broadcast.html +++ b/examples/broadcast.html @@ -34,8 +34,51 @@ username, // Author permlink, // Permlink '', // Title - 'This is a test!', // Body, - { tags: ['test'], app: `steemjs/examples` }, // Json Metadata + 'This is a test!', // Body + { 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) { console.log(err, result); }