Update on Steem Bot Analysis :Range Selection for dates

in utopian-io •  7 years ago  (edited)

New Features added to SteemBotAnalysis

SteemBotAnalysis is a tool developed to analyze :

  • How old are the posts at the date of upvote
  • According to the chosen bots
  • According to the chosen date ( with the new feature, the range of dates )

Features added

  • Before

Only one-day selection was available.The analysis was made on a single day.

image.png

  • After

A range of selection is available with START DATE and END DATE

image.png

With this improvement, it is possible to make the analysis for a longer range of time in one page.

Implementation of the changes

  • Addition of the second date picker
<form action="/action_page.php" class="gwd-form-d3aa">
      Start Date:
      <input type="date" id="Sday" name="Sday" value="<?php echo $today; ?>">End Date:
      <input type="date" id="Dday" name="Dday" value="<?php echo $today; ?>">
    </form>

With this addition, the date picker also starts from the current date with the PHP code implemented.

  • Selecting & filtering according to the date
var selectedDate = document.getElementById('Sday').value;
          var selectedDateUnix = moment(selectedDate, "YYYY-MM-DD").valueOf();
          // date range addition
          var nextDate = document.getElementById('Dday').value;
          var nextDateUnix = moment(nextDate, "YYYY-MM-DD").valueOf();
        
          steem.api.getAccountVotes(bot, function(err, result) {
            var accountVotes = result;
            // Filter and return all of the account votes between the selected date and the next
            var accountVotesFilteredForSelectedDate = _.filter(accountVotes, function(accountVote) {
              var accountVoteDateUnix = moment(accountVote.time).valueOf();
              return (accountVoteDateUnix >= selectedDateUnix && accountVoteDateUnix <= nextDateUnix);
            });

The full code for the project can be found here

Links

Steem Bot Analysis: https://fdsteemtools.neocities.org/botanalysis.html

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

Contact

@FireDream - Steemit

@firedream#3528 - Discord

Proof of Work

image.png

Link to relevant lines in the code on GitHub and explain briefly what you added/changed.

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:  

Thank you for your contribution.


Need help? Write a ticket on https://support.utopian.io.
Chat with us on Discord.

[utopian-moderator]

Thank you @codingdefined

FD.

Your Post Has Been Featured on @Resteemable!
Feature any Steemit post using resteemit.com!
How It Works:
1. Take Any Steemit URL
2. Erase https://
3. Type re
Get Featured Instantly & Featured Posts are voted every 2.4hrs
Join the Curation Team Here | Vote Resteemable for Witness

Hey @firedream

We're already looking forward to your next contribution!

Utopian Witness!

Vote for Utopian Witness! We are made of developers, system administrators, entrepreneurs, artists, content creators, thinkers. We embrace every nationality, mindset and belief.

Want to chat? Join us on Discord https://discord.gg/h52nFrV