
TFBOT v1B4.100324.1 Test 1
The reputation number from hive.api.getAccounts has been broken for a while. I still see many places where it shows everyone's rep as 25 which is the default initial value.
I found another way to get an account's reputation using this javascript.
function getAuthorReputation(author) {
// get Reputation Number!
fetch('https://api.hive.blog', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'bridge.get_profile',
params: {
account: author,
observer: author,
},
id: 1,
}),
})
.then(response => response.json())
.then(data => {
// Handle the response data here
console.log('bridge.get_profile Reputation: ' + data.result.reputation);
})
.catch(error => {
// Handle any errors
});
}
So now I am testing my new @tokenfaucet bot with this reputation check code.
I want to only give a reward to accounts with a reputation of 30 or more, and I use the above to check the reply author's rep.
This post is just for my own testing purposes but if anyone has any questions, ask here or find me (@kenny-crane) on discord or X.
Leave TFBOT v1B4.100324.1 Test 1 to:
Read more #programming posts
Best Posts From ktest
We have not curated any of ktest's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.