Votezy STEEM Bot v0.0.1 - An Open NodeJS Source "Pay-4-Vote" Script (Offline Currently!)

in #utopian-io7 years ago (edited)

Want to be a Pay-4-Vote Service Like @minnowbooster or @randowhale
Feel like you are up to the task of being yet another paid voting service?!
 

Got A Friggin' WICKED Chunk of Code For You!

Introducing Votezy, a brand new, barely working, nearly untested NodeJS script that allows you to run any account you own as one of those fancy paid for vote services. After a number of users decided to start sending me 1.000 SBD and a link to get an upvote and my subsequent frutration that followed this script was born, mostly to stop me from freaking out when people were hounding me to upvote their stuff really.. Figured I may as well share it!

Votezy STEEM Bot - How Does it Work?!

Poorly, but jokes aside at my somewhat archaic coding on this script... The code featured below allows you to turn your account into a voting bot that casts random votes whenever a user tips your account over a pre-determined amount.. Then comments on the voted on post showing what percentage the upvote given was. While this script is somewhat functioning the truth is this is a basically untested early alpha version and should not be run by anyone not willing to have their account potentially go crazy due to unforseen bugs in the code (which there almost certainly is) so please deploy this script at YOUR OWN RISK.

Want a RANDOM Upvote From @KLYE?

For those brave or insane enough to gamble their hard earned SBD or STEEM I invite you (at your own risk with no liability or refunds) to send 1.000 or more SBD or STEEM to this @KLYE account with the memo containing only the Steemit.com link you wish to get upvoted.

Within a few minutes assuming the script isn't crashed or being bugged (which is a possibility) you'll receive a RANDOM 0.01% - 100% vote worth up to ~$8.000 SBD on the post provided in memo. Don't like the amount you got voted? Send again and try your luck!

Any transfers less than 1.000 SBD/STEEM sent with a link will be considered a donation!

~~~WARNING:~~~

@KLYE holds no responsibility for voting insanity caused by this script!
Also no refunds or any support is offered for this service.. USE AT OWN RISK!

Installation and Configuration

Being a NodeJS script the first thing you're gonna need is NodeJS running on some system you have access to. Not sure what the minimum system requirements are yet..

The official NodeJS site can be found here: https://nodejs.org/en/download/current/

Install that to your system, hopefully grabbing the correct version for your operating system.. After that you'll need to grab the script below and save it to a file called "votezy001.js" or whatever you wish really.

////////////////////////////////////////////////////////////////////////////////
//-----  VOTEZY STEEMIT.COM Bot v0.0.1 - An Open NodeJS Source "Pay-4-Vote" Script
//-----  A functional yet probably not wise to run paid voting script in nodeJS
//----- Written, Tested (barely), Butchered and Released by: @KLYE steemit.com/@klye
//----- Like this Script and want More?! Please vote my witness efforts!
////////////////////////////////////////////////////////////////////////////////
// Add your Account Info Here!
var votebot = "klye"; // Account to Run Bot on
var wif = ""; // Posting Private Key Here

// NO NEED TO MODIFY THESE
var steem = require('steem');
var metadata = {
    "app": "votezy/0.0.1"
};
var opscan = 0;
var errorconn = 0;
// ----- SLEEP Function to unfuck some nodeJS things - NO modify
function sleep(milliseconds) {
    var start = new Date().getTime();
    for (var i = 0; i < 1e7; i++) {
        if ((new Date().getTime() - start) > milliseconds) {
            break;
        }
    }
};

// Lets Start this script!
console.log("Starting Votezy v0.0.1 on @" + votebot + " - Script By @KLYE");
// Fix to send to new API server
steem.api.setOptions({ url: 'https://api.steemit.com'});
steem.config.set('websocket', 'wss://steemd.steemitdev.com');
//steem.api.setOptions({ url: 'https://steemd.privex.io' });
// Start the script scanning
trannyscanner();

// The Transaction Streamer function
function trannyscanner() {

    // Stream irreversible Operations
    steem.api.streamOperations('irreversible', function(err2, safeblockops) {
        // If operations call to RPC f*cks up
        if (err2) {
            errorconn++;
            if (errorconn % 3 === 0) {
                console.log("ERROR - RPC Connection Lost/Timeout");
                console.log("Attempting to Reconnect to Official Steemit.com RPC now..!");
                steem.api.setOptions({
                    url: 'https://api.steemit.com'
                });
                steem.config.set('websocket', 'wss://steemd.steemitdev.com');
                trannyscanner();
                sleep(2000);
                return;
            } else {
                console.log("ERROR - RPC Connection Lost/Timeout");
                console.log("Attempting to Reconnect to rpc.buildteam.io RPC now..!");
                steem.api.setOptions({
                    url: 'https://rpc.buildteam.io'
                });
                steem.config.set('websocket', 'wss://gtg.steem.house:8090');
                trannyscanner();
                                sleep(2000);
                return;
            };
        };
        // If we get operations from server
        if (safeblockops) {
            // get 1st item in blockops an apply to operationType variable to check type later
            var opType = safeblockops[0];
            // get 2nd item in blockops and store it later to be parsed if it's our specified type of operation
            var op = safeblockops[1];
            //check if current operation is a comment
            if (opType == "transfer") {
                opscan++;
                console.log("Transfer Scanned: " + opscan);
                process_transfer(op);
            }
        };
    }); // END streamOperations irreversible!!!
}; // End trannyscanner

// Transfer operation found? Lets see if it is for us!
var process_transfer = function(op) {
    if (op["to"] == votebot) {

        var depositer = op["from"];
        var reciever = op["to"];
        var firstdepo = op["amount"];
        var currency = op["amount"];
        var depositmemo = op["memo"];
        var chaching = parseFloat(currency);
        var type = currency.substring(currency.lastIndexOf(" ") + 1);
        // Unused "if no memo" logic
        if (depositmemo == undefined) {
            //console.log(time + " - " + chaching + " " + type + " Transfer from @" + depositer + " to @" + reciever);
        } else {
            // Look for Steemit.com Link
            if (depositmemo.toLowerCase().indexOf("https://steemit.com") >= 0) {
                if (chaching >= 0.001) {
                    console.log(chaching + " " + type + " transfer from @" + depositer + " to @" + reciever + " Detected with Memo Containing Link:");
                    console.log(depositmemo);
                    var parentAuthor = depositmemo.match(/\/@(\w*)\//)[1];
                    console.log("Parent Author: " + parentAuthor);
                    var permlink = depositmemo.substring(depositmemo.lastIndexOf("/") + 1);
                    console.log("Permalink: " + permlink);
                    var weight = Math.floor(Math.random() * 10000);
                    var weightpercent = parseFloat(weight / 100).toFixed(2);
                    // Prepare vote response
                    var balancetable = [
                        "| <center><h4>@" + parentAuthor + " Got a <b>" + weightpercent + "%</b> Vote via @" + votebot + "</h4></center> |",
                        "|:----:|",
                        "| <center>Send any amount of STEEM or SBD Over 1.000 & Recieve a RANDOM @KLYE VOTE<br>Make sure to include the link to your post in the memo field of the transfer!<br><sub>( Any amounts < 1.000 STEEM or SBD will be considered donations )</sub></center> |",
                        "| <center>Vote power is Generated via RNG (Random Number Generator)</center> |"
                    ].join("\n");
                    var title = "@KLYE Pay-4-Vote Report:";
                    //reply comment
                    steem.broadcast.vote(
                        wif,
                        votebot,
                        parentAuthor,
                        permlink,
                        weight,
                        function(err, result) {
                            // if it f**ks up...
                            if (err) {
                                console.log("Pay-4-Vote FAILED");
                                console.log(err);
                                return;
                            };
                            // If it wins
                            if (result) {
                                console.log("Pay-4-Vote Success! Upvote of " + weightpercent + "%!");
                                replycomment(wif, parentAuthor, permlink, votebot, permlink, title, balancetable, metadata);
                            };
                        });
                }
            };
        }
    };
};

// Send a voted comment
var replycomment = function(wif, parentAuthor, permlink, votebot, permlink, title, content, metadata) {
    //broadcast comment
    steem.broadcast.comment(wif, parentAuthor, permlink, votebot, permlink, title, content, metadata, function(commentfailz, commentwinz) {
        if (commentfailz) {
            console.log("Error");
            // Load first op without removing
            steem.broadcast.comment(wif, parentAuthor, permlink, votebot, permlink, title, content, metadata, function(errqc, winqc) {
                if (errqc) {
                    console.log("ERROR Sending Comment!");
                }
                if (winqc) {
                    console.log(parentAuthor + "'s Response Sent");
                }
            });
        }; //END  if (commentfailz)
        if (commentwinz) {
            console.log(parentAuthor + "'s Response Sent");

        }
    });

}; //END replycomment

After you've got the script above copied down to a file of your choice it's now time to install the SteemJS dependency using the following command in the same folder you've saved the votezy001.js file (or whatever you named it)...

npm install steem

After that it's just a matter of running it in your console after filling in your account name and provate posting key in the top lines of the script to allow it to vote from your account as transfers of 1.000 STEEM/SBD or over are detected!

Of course after filling in the top few lines with the info required you run it with:

node votezy001.js

And almost like magic if you didn't bork something it should run!

Sometimes the RPC nodes time out or drop you... Have no fear!

The script will try to connect to another RPC node and continue.

CONGRATS, You're Now A "Pay-4-Vote" Service

Official Votezy Github Link:
https://github.com/klye-steem/votezy

!!! Disclaimer !!!

This script is about as alpha and untested as they come, expect bugs.. Like a colony or swarm of them. This code was shared more for reference or a learning tool than a production ready service. As stated early I offer no support, warranty, refunds or responsibility for whatever happens if you choose to use this insanity! Good luck on your votes!

USE THIS SCRIPT AND KLYE UPVOTING SERVICE AT YOUR OWN RISK!



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Learning post, I learned a lot in this post. I got very serious information in this post. Thank you very much for the fact that you shared an informative post among us. I want you to come up with more information for us next time. Everything is fine. I want your best wishes @klye

Hey @klye, can you please remove the banner at the bottom because in Utopian.io contribution we do not allow it.

Contributors should not ask for witness votes in their Utopian posts.

Ahh crap. I didn't read that part... Doing so now

Done now. Will avoid my witness banner in the future if posting from utopian.io

Hello @klye, I sent 1.000 sbd to you but I've not received the vote yet. Kindly check it for me.

No refunds or support on this thing man.. It's experimental at best and not advised to use yet.. XD

R.I.P. @klye’s voting power

RIP anyone brave enough to send this ridiculous app anything.. It's certainly got a bit of a tendency to runaway vote spam the users.. lmao. Working on a few fixes now

Okay....it works, thanks for you valuable vote

it works... Sometimes! XD

Hi, Klye
may I ask you abot @tipy bot? Will it work more?

Tippy is still under development... It's a MASSIVE undertaking and almost 2500 lines of code at this point.

I'll get it up and running in alpha development mode soon enough.

Cool! I am waiting for announcement))))

Okay, @klye I will try it for my next post. So could I use to give it for other person who deserves better vote?

Uhmm... After I am thinking again. Okay I will try now

You can put any link in the memo to get voted.. As long as it is fresh!

Lol, this should be interesting

If by interesting you mean chaos... Likely.

I classify anything outside of the ordinary as interesting, But here I did mean chaos XD

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

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • 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

Cool. Sending 2 sbd immediately

You are a brave soul.. I suggest trying it with 1 first.. It sometimes goes nuts.. And I'm not held responsible for the crazy thing eating your money or spamming you! XD

Yeah. It actually ate my money but I am not blaming you for that. It went real nuts upvoted me like 5 times in a real decreasing manner

gygy.PNG

Good Job, though.

I think my 2sbd test revealed some info about it.

keep it up!

I'll send ya back your $2 to try again.. I'm not doing a refund.. I'm paying you for the feedback! ;)

Also LOL. It ate your money and spammed you.. XD ffs

Thanks man

Okay. Thanks lol

You are welcome. I appreciate the help debugging. <3

Coin Marketplace

STEEM 0.20
TRX 0.25
JST 0.039
BTC 97402.80
ETH 3477.48
USDT 1.00
SBD 3.19