SteemFlag - Downvote analysis and Date Selection added

in utopian-io •  7 years ago  (edited)

New Features

1. Async. function problem solved.

  • BEFORE

The project was working manually due to async function problem in Steem.js API.
3 buttons to be used simultaneously visualy confirming data is loaded to div.
image.png

  • AFTER

Async. function problem solved with call to external function.

var flagger = document.getElementById("input_flagger").value
steem.api.getAccounts([flagger], function(err, response) {

The result is sent to an external function.
No promise or callback used.

calc(result,flagger);
});

This way the manual operation is cancelled and the DIV is loaded automatically.
We have the complete RESULT array in CALC function to operate.

image.png

Additionally, a "SPINNER" to the upper left corner is added to inform the user he has to wait.

2. Date Selection added.

  • BEFORE

There was no date selection, the data was analysed as from the beginning.
Hence, there exists a limitation for 10 000 data.

  • AFTER

image.png

Date selector is added to the project.
With selected date, the data is seperated in FOR loop with IF statement.

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)&&(result[i][1].timestamp>selectedDate)) {

With above code, the downvotes "after the selected date" is filtered.

3. Hyperlinks to the downvoted posts added.

  • BEFORE

Hyperlinks of the downvoted posts didn't exist.
image.png

  • AFTER

Hyperlinks are added, so user can see the downvoted posts and comments.
image.png

var str ="https://steemit.com/@"+result[i][1].op[1].author+"/"+result[i][1].op[1].permlink;
var lin=(result[i][1].op[1].permlink).substring(0,70)+".......";

Hyperlinks are limited with 70 characters to fit the DIV.

4. Analysis Modal window added.

  • BEFORE

Analysis were limited.

image.png

  • AFTER

Analysis is shown in a seperate modal window, full sorted from maximum times downvoted user to minimum.
image.png
The sorting code :

image.png

Links

GitHub : https://github.com/firedreamgames/steemflag

WebPage : https://steemflag.neocities.org

Proof of Work

image.png

Connect

@FireDream - Steemit

@firedream#3528 - Discord



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Good stuff. Not sure if it will help you or not, but I did this tutorial on searching account history by date and making the results for-loop-friendly. You can do:

async function main() {
    const result = seek("anonsteem", "2017-10-11");
    for await (const item of result) {
        console.log("Record %s", JSON.stringify({ operation: item.op[0], timestamp: item.timestamp }));
    }
}

Keep up the good stuff. I may use some of this for our reports in the dashboard.

Thanks @r351574nc3, i am still working on improving my js.
This will be help.

FD.

Thank you for the contribution. It has been approved.

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

Thank you.

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