Automation Scripts for Developers and Makers
<p dir="auto"><center><br /><br />
<span>
<img src="https://images.hive.blog/768x0/https://github.com/dehenne/automation-scripts/raw/master/logo-from-undraw--thank-you.png" srcset="https://images.hive.blog/768x0/https://github.com/dehenne/automation-scripts/raw/master/logo-from-undraw--thank-you.png 1x, https://images.hive.blog/1536x0/https://github.com/dehenne/automation-scripts/raw/master/logo-from-undraw--thank-you.png 2x" />
<p dir="auto">I love automatisms. Every developer should put more into automatisms.<br />
For quite some time now I have been building scripts which take over a lot of work.<br />
Since the scripts are getting more and more I started a repository where I collect all my scripts.
<h4>Repository
<ul>
<li><span><a href="https://github.com/dehenne/automation-scripts" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/dehenne/automation-scripts
<li>Licence MIT
<h3>New Features
<h4>What feature(s) did you add?
<ul>
<li>Auto vote script for Steemit
<li>Get all users for makerlog
<li>Tweet Maker of the day from Makerlog
<li>Auto vote script for Twitter
<li>Tweet random tweets at Twitter
<h4>How did you implement it/them?
<p dir="auto">Here I would like to show you the newest script. The newest script is an auto vote script for Steemit. So you don't have to give your keys to services. Everything is up to you and therefore more secure.
<p dir="auto">You can find the script itself under:<br /><span>
<a href="https://github.com/dehenne/automation-scripts/tree/master/steem/auto-vote" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/dehenne/automation-scripts/tree/master/steem/auto-vote
<p dir="auto">The whole script is designed to run with <a href="https://de.wikipedia.org/wiki/Cron" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Cron.<br />
This was supported by the latest patch <a href="https://github.com/dehenne/automation-scripts/commit/0ca7c94e9b2edd11e0e32e0ff0aac9497a3b13fc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">patch 0ca7c94
<h4>What do you need now
<ul>
<li>NodeJS
<li>NPM
<h4>How to install it
<ul>
<li><br />
Either copy the files to a location of your choice or check it out with git.<span>Export the auto-vote folder (<a href="https://github.com/dehenne/automation-scripts/tree/master/steem/auto-vote" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/dehenne/automation-scripts/tree/master/steem/auto-vote)
<p dir="auto"><code>git clone git@github.com:dehenne/automation-scripts.git
<ul>
<li>Execute npm installation
<p dir="auto"><code>npm install
<ul>
<li>Fill in all config parameters
<p dir="auto">Please fill in all settings in the <code>config.js file.
<pre><code>
// which users should be voted
let USERS = ['username', 'username', 'username'];
// Weighting of votes
const CONFIG_WEIGHT = 10000;
// User name of the voter
const USERNAME = 'YOUR-USERNAME';
// Password of the voter
const PASSWORD = 'YOUR-PASSWORD';
<ul>
<li>Run the script by <code>nodejs run.js
<p dir="auto">If you want to run the whole thing automatically you can use cron to do this.<br />
I recommend to run this every 5 minutes.
<pre><code>*/5 * * * * cd PATH_TO_THE_SCRIPT; nodejs run.js
<p dir="auto"><span>A good explanation on how to use cron can be found at <a href="https://wiki.ubuntuusers.de/Cron/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://wiki.ubuntuusers.de/Cron/.
<h4>The Run Script
<p dir="auto">The run script is quite simple. It votes only on posts that are older than 15 minutes, noticed if you voted already and votes only posts that are younger than 5 days.
<p dir="auto">The complete source code is documented as usual.<br />
The most important functions are:
<ul>
<li><span>getUserPosts <a href="https://github.com/dehenne/automation-scripts/blob/master/steem/auto-vote/run.js#L36" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/dehenne/automation-scripts/blob/master/steem/auto-vote/run.js#L36
<li><span>voteOnPost <a href="https://github.com/dehenne/automation-scripts/blob/master/steem/auto-vote/run.js#L114" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/dehenne/automation-scripts/blob/master/steem/auto-vote/run.js#L114
<li><span>isAlreadyVoted <a href="https://github.com/dehenne/automation-scripts/blob/master/steem/auto-vote/run.js#L140" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/dehenne/automation-scripts/blob/master/steem/auto-vote/run.js#L140
<h4>GitHub Account
<ul>
<li><span><a href="https://github.com/dehenne" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/dehenne
<p dir="auto">For further ideas of some automation scripts you are welcome to write me an issue.
<p dir="auto">Thanks for reading<br />
Hen
First of all, welcome back! I think most developers create similar scripts that automate stuff - it's only natural since we are so lazy. ;) Some cool scripts there, but I've never heard of Makerlog. It looks pretty interesting, so I might check it out!
<p dir="auto">As for the code (I used <a href="https://github.com/dehenne/automation-scripts/compare/021e594c4a34ee584829503c70b60441ed51190e...master" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">this link to check the changes), here are some thoughts: <ul> <li>The indentation and naming of variables are weird imo. Lining up all <code>= isn't necessary, and things aren't consistently camelCase, but I guess that's up to you. <li>Small inconsistencies like mixing of <code>let when <code>const can be used. <li>Better to use <code>forEach instead of a normal <code>forloop, since you aren't actually counting anything and it's a lot more readable. <li>Maybe it's better to use a separate configuration file instead of having them as variables in the JavaScript file itself. <p dir="auto">All in all, it could be pretty useful for some people! However, since programmers themselves probably already have something like this (the autovoter), I think the target audience is more than likely people who don't code, and so it could be more user friendly in my opinion. Anyway, as I said before, it's great to have you back, and I hope to see more contributions from you (and the rest of the PCSG guys) in the future! <hr /> <p dir="auto">Your contribution has been evaluated according to <a href="https://join.utopian.io/guidelines" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category. <p dir="auto">To view those questions and the relevant answers related to your post, <a href="https://review.utopian.io/result/3/2-3-2-2-2-1-1-" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">click here. <hr /> <p dir="auto">Need help? Chat with us on <a href="https://discord.gg/uTyJkNm" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Discord. <p dir="auto"><a href="https://join.utopian.io/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">[utopian-moderator]Thank you for your review, @amosbastian! Keep up the good work!
Hi @dehenne!
Feel free to join our @steem-ua Discord serverYour post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation! Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
🙏👍
Hey, @dehenne!
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Get higher incentives and support Utopian.io!
SteemPlus or Steeditor). Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!