SteemFlag - Steem.js project for analysing downvote history

in #utopian-io6 years ago (edited)

SteemFlag A project to analyse Steemit downvote history

Aim of the project

SteemFlag is a website for analysing the downvote history of a Steemit user.
With this tool, the user can :

  1. Analyse which users are downvoted by selected user
  2. Analyse what is the total downvote power used, in total and exactly on which user
  3. Analyse if the downvote power is mostly used on minnows, dolphins or whales
  4. Discriminate if the user is flagging spams or is in a flag fight with some other user

Using the website

The website is coded in HTML and JavaScript and it is working at client side.
Not to mess with the asynchronous functions, the usage is set to be mostly manual.

  • Goto SteemFlag website.

  • Main view
    image.png

  • Enter the steemit name of the user you want to analyse
    image.png

  • Press the " Search Data " button to start searching downvotes
    image.png

  • Wait for the first part of data to be written on the page
    image.png

  • After first part of data is on the page, press " Get Stats " button to read the stats of the people downvoted.
    image.png
    image.png
    This will show the flagged persons SP and define if he/she is a minnow, dolphin or whale.

  • Taking this data, press the " Calculate " button
    image.png

  • This will calculate :

  • How much downvote power is used on minnows
  • How much downvote power is used on dolphins
  • How much downvote power is used on whales

image.png

How the project works and the code

The project is written in HTML and JavaScript using steem.js API.
It is an open-source project and the code can be found in GitHub: https://github.com/firedreamgames/steemflag

The code working is basically as follows :
First we have to get the steem data

steem.api.getDynamicGlobalProperties(function(err, result) {
document.getElementById("vesting_shares").innerHTML = result.total_vesting_shares;
document.getElementById("vesting_fund").innerHTML = result.total_vesting_fund_steem;
});
This is used to calculate the SP of the downvoter and the downvoted user.

Then we calculate the SP of the downvoter.

steem.api.getAccounts([flagger], function(err, response) {
console.log(response);
vesting_shares = response[0].vesting_shares.split(' ')[0];
delegated_vesting_shares = response[0].delegated_vesting_shares.split(' ')[0];
received_vesting_shares = response[0].received_vesting_shares.split(' ')[0];
total_vesting_shares = document.getElementById("vesting_shares").innerHTML;
total_vesting_fund_steem = document.getElementById("vesting_fund").innerHTML;
console.log(vesting_shares, delegated_vesting_shares, received_vesting_shares);
var steem_power = steem.formatter.vestToSteem(vesting_shares, total_vesting_shares, total_vesting_fund_steem);
var delegated_steem_power = steem.formatter.vestToSteem(received_vesting_shares - delegated_vesting_shares + ' VESTS', total_vesting_shares, total_vesting_fund_steem);
document.getElementById("txt_fp").innerHTML = (steem_power + delegated_steem_power).toFixed(2);
});

We get the flagged posts with getAccountHistory

steem.api.getAccountHistory(flagger, -1, 10000, function(err, result) {
console.log(result.length);
for (let i = 0; i < result.length; i++) {
if ((result[i][1].op[0] == 'vote') && (result[i][1].op[1].voter = flagger) && (result[i][1].op[1].weight < 0) && (result[i][1].op[1].author != flagger)) {
document.getElementById("vic_name").innerHTML = document.getElementById("vic_name").innerHTML + result[i][1].op[1].author + "
";
document.getElementById("vic_SBD").innerHTML = document.getElementById("vic_SBD").innerHTML + (result[i][1].op[1].weight / 100) + " %" + "
";
}
}
});

With a function similar to above one, we calculate the SP power of each downvoted user and determine if he/she is a minnow, dolphin or whale.

Then we read the data from the innerHTML ( this way function is sychronized ) and calculate the downvote totals for each group and write in the assigned div.

Roadmap

Flagging can be and is used for many reasons in Steemit.

  • To punish spam post
  • As an attack
  • As a defense against attackers
    It is important to have a handy tool to analyse users behaviours to use the downvote option.

The project is planned to be extended to:

  • Work in a selected time slot
  • Convert the % downvotes to SBD and see how much reward is downvoted.
  • Cancel manual operation and use promises to handle asynchronous functions.

How to contribute?

The project needs contribution on

  • Asynchronous function solution, so cancel 3 buttons to 1 calculate button
  • Formulation and script to convert %downvoted to SBD stripped
  • Timeslot selection to see daily, weekly or any time performance of downvote.

Task requests will be opened on these 3 issues.

Proof of work

image.png



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

@vladimir-simovic Thank you.

For slow working, i think this depends on reading data from steem database.
For firefox, i didn't try...it is working on chrome and opera and it is not working on IE ( just tried )

I will open a task request for asynchronous functions and imply this problem also.

FD.

Hey @vladimir-simovic, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Hey @firedream I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thank you.
FD.

I have just tested the website (https://steemflag.neocities.org/), but unfortunately I can't get any results in Firefox and Google Chrome (Windows 7).

Edit: Ah, now it works. It takes a long time for things to change. A visual feedback that is currently being searched for might be recommended. It works on Chrome but not with Firefox.

Coin Marketplace

STEEM 0.28
TRX 0.11
JST 0.031
BTC 69371.89
ETH 3768.85
USDT 1.00
SBD 3.71