Skip to content

Instantly share code, notes, and snippets.

@code-with-sam
Created January 22, 2018 00:03
Show Gist options
  • Save code-with-sam/0df6e6bfdbf91fa3f69374dcf452b00c to your computer and use it in GitHub Desktop.
Save code-with-sam/0df6e6bfdbf91fa3f69374dcf452b00c to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Bot's in Steem-js</title>
<script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
<script>
console.log('Hello, Is Anybody OUt There!?')
// Tutorial 06 - Auto Claim Bot
const ACCOUNT_NAME = ''
const ACCOUNT_KEY = ''
const INTERVAL = 60 * 60 * 1000
steem.api.setOptions({ url: 'wss://rpc.buildteam.io' });
setInterval(claimBalance, INTERVAL)
function claimBalance(){
steem.api.getAccounts([ACCOUNT_NAME], function(err, result){
console.log(err, result)
let sbdReward = result[0].reward_sbd_balance
let steemReward = result[0].reward_steem_balance
let steemPowerInVests = result[0].reward_vesting_balance
steem.broadcast.claimRewardBalance(ACCOUNT_KEY, ACCOUNT_NAME, steemReward, sbdReward, steemPowerInVests, function(err, result) {
console.log(err, result);
});
})
}
</script>
</head>
<body>Check The Console.</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment