SteemTools v0.0.6 – Check Who Downvoted You + API Server Ping


Introduction to SteemTools

SteemTools is inspired by its sister project: Utopian Moderators & Supervisors and it provides a set of useful data, tools, statistics for SteemIt Users.

Github of SteemTools

https://github.com/DoctorLai/SteemTools/

Previous Contributions

Technology Stack

Javascript that runs in the Chrome Browser (Chrome Extension)

Chrome Webstore

It is online, and you can install SteemTools via Google Webstore.

If you are using Firefox, you can still install this Extension by Chrome Extension Foxified.

New Features of SteemTools v0.0.6

Along with bug fixes, code refactoring, this version has the following new features.

  • Tab Downvoters so you can see who downvoted you in the past year.
  • API Server Ping Tests.

Commits

Here

Screenshots

api-server-ping-tests SteemTools v0.0.6 - Check Who Downvoted You + API Server Ping chrome extension javascript SteemIt

API Server Ping Tests

Check Who Downvoted You in the last 365 days.

steemtools-downvote SteemTools v0.0.6 - Check Who Downvoted You + API Server Ping chrome extension javascript SteemIt

steemtools-downvote

SteemIt: Javascript Downvote List

The following connects to API server and gets a list of steemit downvoters.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// check who downvoted you
// search a id when press Enter
textPressEnterButtonClick($('input#downvoters_id'), $('button#downvote_btn'));
$('button#downvote_btn').click(function() {        
    let id = prepareId($('input#downvoters_id').val());
    let server = getServer();        
    server = server || default_server;
    $('div#downvoters_div').html('<img src="images/loading.gif"/>');
    if (validId(id)) {
        // disable the button while API is not finished yet.
        $('button#downvote_btn').attr("disabled", true);
        $.ajax({ 
            dataType: "json",
            url: "https://" + server + "/api/steemit/downvote/?cached&id="+id,
            cache: false,
            success: function (response) {
                let result = response;
                if (result && result.length > 0) {
                    let s = '<h4><B>' + result.length + '</B> downvotes in the past year.</h4>';
                    s += '<table id="downvote_list" class="sortable">';
                    s += '<thead><tr><th>Down-Voter</th><th>Permlink</th><th>Weight %</th><th>Time</th></tr></thead><tbody>';
                    let total = 0;
                    for (let i = 0; i < result.length; ++ i) {
                        s += '<tr>';
                        total += result[i]['weight'] / 100;
                        s += '<td>' + getSteemUrl(result[i]['voter']) + '<BR/><img style="width:75px;height:75px" src="https://steemitboard.com/@' + result[i]['voter'] + '/level.png"></td>';
                        s += '<td>' + '<a target=_blank rel=nofollow href="https://steemit.com/@' + id + '/' + result[i]['permlink'] + '">' + result[i]['permlink'] + '</a></td>';
                        s += '<td>' + (result[i]['weight']/100).toFixed(2) + '</td>';
                        s += '<td>' + result[i]['time'] + '</td>';
                        s += '</tr>';
                    }              
                    s += '<tfoot><tr>';
                    s += '<th>Total: </th><th></th><th></th><th>' + total.toFixed(2) + '</th><th></th>'; 
                    s += '</tr></tfoot>';
                    s += '</table>';                 
                    $('div#downvoters_div').html(s);
                    sorttable.makeSortable(document.getElementById("downvote_list"));
                } else {
                    $('div#downvoters_div').html("<font color=blue>It could be any of these: (1) No Deleted Comments (2) Invalid ID (3) API or SteemSQL server failed. Contact <a rel=nofollow target=_blank href='https://steemit.com/@justyy/'>@justyy</a> if you are not sure. Thanks!</font>");
                }          
            },
            error: function(request, status, error) {
                $('div#downvoters_div').html('<font color=red>API/SteemSQL Server (' + server + error + ') is currently offline. Please try again later!' + request.responseText + '</font>');
            },          
            complete: function(data) {
                // re-enable the button
                $('button#downvote_btn').attr("disabled", false);
            }
        });
    } else {
        alert('Not a Valid Steem ID.');
        $('div#downvoters_div').html('');
    }        
});  
// check who downvoted you
// search a id when press Enter
textPressEnterButtonClick($('input#downvoters_id'), $('button#downvote_btn'));
$('button#downvote_btn').click(function() {        
    let id = prepareId($('input#downvoters_id').val());
    let server = getServer();        
    server = server || default_server;
    $('div#downvoters_div').html('<img src="images/loading.gif"/>');
    if (validId(id)) {
        // disable the button while API is not finished yet.
        $('button#downvote_btn').attr("disabled", true);
        $.ajax({ 
            dataType: "json",
            url: "https://" + server + "/api/steemit/downvote/?cached&id="+id,
            cache: false,
            success: function (response) {
                let result = response;
                if (result && result.length > 0) {
                    let s = '<h4><B>' + result.length + '</B> downvotes in the past year.</h4>';
                    s += '<table id="downvote_list" class="sortable">';
                    s += '<thead><tr><th>Down-Voter</th><th>Permlink</th><th>Weight %</th><th>Time</th></tr></thead><tbody>';
                    let total = 0;
                    for (let i = 0; i < result.length; ++ i) {
                        s += '<tr>';
                        total += result[i]['weight'] / 100;
                        s += '<td>' + getSteemUrl(result[i]['voter']) + '<BR/><img style="width:75px;height:75px" src="https://steemitboard.com/@' + result[i]['voter'] + '/level.png"></td>';
                        s += '<td>' + '<a target=_blank rel=nofollow href="https://steemit.com/@' + id + '/' + result[i]['permlink'] + '">' + result[i]['permlink'] + '</a></td>';
                        s += '<td>' + (result[i]['weight']/100).toFixed(2) + '</td>';
                        s += '<td>' + result[i]['time'] + '</td>';
                        s += '</tr>';
                    }              
                    s += '<tfoot><tr>';
                    s += '<th>Total: </th><th></th><th></th><th>' + total.toFixed(2) + '</th><th></th>'; 
                    s += '</tr></tfoot>';
                    s += '</table>';                 
                    $('div#downvoters_div').html(s);
                    sorttable.makeSortable(document.getElementById("downvote_list"));
                } else {
                    $('div#downvoters_div').html("<font color=blue>It could be any of these: (1) No Deleted Comments (2) Invalid ID (3) API or SteemSQL server failed. Contact <a rel=nofollow target=_blank href='https://steemit.com/@justyy/'>@justyy</a> if you are not sure. Thanks!</font>");
                }          
            },
            error: function(request, status, error) {
                $('div#downvoters_div').html('<font color=red>API/SteemSQL Server (' + server + error + ') is currently offline. Please try again later!' + request.responseText + '</font>');
            },          
            complete: function(data) {
                // re-enable the button
                $('button#downvote_btn').attr("disabled", false);
            }
        });
    } else {
        alert('Not a Valid Steem ID.');
        $('div#downvoters_div').html('');
    }        
});  

Roadmap of Steem Tools

License

MIT

Chrome Webstore

Install the SteemTools Chrome Extension Now!

Contribution Welcome

Github: https://github.com/DoctorLai/SteemTools

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am ‘Add some feature’
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request.

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
1281 words
Last Post: Utopian Moderators & Supervisors v0.0.10 - Steem Nodes Ping Tool + Sponsors Tab
Next Post: CoinTools v0.0.4: Conversion Between Two Fiat or Fiat-Coin + 24 Hour Total Market Cap Chart

The Permanent URL is: SteemTools v0.0.6 – Check Who Downvoted You + API Server Ping

Leave a Reply