uxCATling - @ubasti first steps to automation ...

in #rudyarcatlnig6 years ago (edited)

i'm not quite sure what and how the ruleset exactly would go but i thought, since i do the post manually the first i could already achieve is to generate the main body of the text with a liddl scribb'n so

all hail the pipes and substitutions !

i also need another post since the way i figure it right now 3 is the minimum and five would be about the maximum to strike balance between maxxing and too much lol ... i dont have the $5000 a post power yet and i don't know where to find that other than buy 5000 accounts and upvote myself, which, i do agree, i slightly OTT

i thought should i #steemterm or #steemscript but the sbd distro is already a daily thing at once a day and manually writing the whole post, checking the numbers and replacing them is getting on my nerves, a few hours of forcing focus (means in my case 10 minutes at screen the go dish or dry a mug then 5 minutes at keyboard then game 2 minutes then ... that's alas the span i have left, and thats at home ... i wouldnt wanna start ragnarok being forced into an office thats not mine , and thats never gonna happen anyway, lonercat will never be teamplayer if ever he was, i can't remember)

And due to the fabulous nature of linux and the fact i got some actual documentation that doesnt want to shove python or higher lever scribbers up my arse its not very hard, its just hard for me to focus lol or it would probably be done by now


once you get the hang it goes faster ofcourse, you can re-use previous snippets you simply turn into separate 'commands' and to be able to copy-paste from a done script saves a lot of typos for the chaotic mind
it won't take long to have at least this work, so i wont have to check every single time for variables in the text like days old or current steem power or 100% vote worth , no more copypasting from chrome to firefox and manually picking out cashout_time, all that, the little tidbit that calcs SP can be turned quickly to a separate re-usable command
i'm almost feeling like im building a library lol ... of sorts ... re-usability is a good thing, but all that school jargon they waste time on teaching kids how to talk the talk instead of helping them understand the underlying mechanics (where actually all programming logic is one and the same since its all von neumann architecture, was , is , will be for a while i bet) i used to have actual fun with this but since fun does not exist at least it keeps me busy
#!/bin/bash
##################################
ACCOUNTHANDLE=$1
##################################
PAIDPOST=$2
#https://steemit.com/giveaway/@ubasti/sbd-distrobot-upvote-for-equal-share-deadline-at-cashouttime-tue-may-8-15-33-54-cest-2018
##################################
SUFFIX=".json"
wrkACCOUNTHANDLE="@$ACCOUNTHANDLE$SUFFIX"
DOMAIN='https://steemit.com/'
CURLURL="$DOMAIN$wrkACCOUNTHANDLE"
CURLURL2="$PAIDPOST$SUFFIX"
##################################
#unmark for working version / mark while working on version ... save the webz
#wget -qO- $CURLURL |gunzip >ubasti_jsondata
#wget -qO- $CURLURL2 |gunzip >ubasti_paidpost
##################################
AGE=0
TOTALPAID=0
##################################
CASHOUT_TIME=$(grep -Po '(?<=("cashout_time":")).*?(?=(","max_cashout_time))' ubasti_paidpost)
##################################
#The forumla for calculating Steem Power is as follows:
#total_vesting_fund_steem * (user's vesting_shares / total_vesting_shares) https://steemit.com/steem/@lantto/how-to-calculate-steem-power-using-the-api
##################################
#probably best put this in separate command for re-use
##################################
curl --silent --data '{"jsonrpc": "2.0", "method": "get_state", "params": ["post"], "id": 40 }' https://api.steemit.com >state
TVF=$(grep -Po '(?<=("total_vesting_fund_steem":")).*?(?=( STEEM",))' state)
echo $TVF
UVS=$(grep -Po '(?<=("vesting_shares":")).*?(?=( VESTS",))' ubasti_jsondata)
echo $UVS
TVS=$(grep -Po '(?<=("total_vesting_shares":")).*?(?=( VESTS",))' state)
echo $TVS
ubasti_sp=$(echo "$TVF * $UVS / $TVS"|bc -l)
echo $ubasti_sp
cat > temp <<EOF
<blockquote>
please note : if you're feeling generous and want to decline payment for the current post you voted on, the remainder WILL be distributed among those who don't, if YOU do , then please leave it in comment, thanks, otherwise it will pay out even to stale accounts, which is a bit of a shame imo
</blockquote>
<hr>
<sub>@$ACCOUNTHANDLE is $AGE days old and has distributed ${TOTALPAID}SBD to participants</sub>
<hr>

sbd will be distributed for all non-resteem posts that pay out at cashout_time but upvotes will only be raffled on the actual SBD distrobot posts (like this one), it's work in progress but paying out is kinda fun, even if its only at sardine-level 

<sub>
the deadline is ... (12 hours before) $CASHOUT_TIME
<sub>deadline can shift if post is edited afterwards but voting shouldnt be possible from 12 hours before actual deadline at the time of posting
</sub>
<hr>
<sub>
the total SP of @ubasti : $ubasti_sp SP (no delegation)

feel free to whatever its not a license and even if, i wouldnt have the money to patent anything if it were worth it anyway SO ...

it should be put up in a torrent as a zipfile soon enough anyway, but i doubt it will be very useful to anyone but me since the intention is to run it all on a vocore from a terminal in the end im just not sure on how to do the three upvotes i give away to random participants since so far as manual i make sure it doesnt go to stale accounts and preferably not to posts that won't be pushed above dust treshold either so ... that will need some sifting through the raw flat files there but well ... i actually

i DO have all night, don't i ?

vocore2
just CUZZzzz, cuz i has one and its gathering dust and it looks so lonely

that's why ...
or something hmm.. 5am

the night is dying , shit

tux-linux-professional-100520475-orig.png

3.png

Sort:  

the enemy is called redundancy in all systems and is a rule of thmb of all great programmers unless your paid by the line :))

i sometimes fear the age of k-locks is back upon us because most pc programming seems to simple expect you to upgrade to the latest standards of the developers hardware (kingdom come for instance was about the worst disaster i have seen since crysis (same engine) so only the super tweakers with 4k (in dollar) pcs could really play it well hahah) i'm so out of votes lately, trying hard to catch up and race to sustainability ... at least i got slightly assured the ein-vote ein-account won't be happening anytime soon, thats a good thing.
I don't actually have any kind of formal education in IT , it's the one thing i have always avoid in both school and in "working for someone else" i always feared they would drain all the fun.
But they found other ways to do that lol so i'm mostly empirical and not very frameworked or structured, the working versions tend to grow into copies of da vincis notes lol but when its actually usable and everything gets deleted it shrinks somewhere between 50-90% in size lol
its why i prefer not to use python too, its not necessary , for one thing and i fear anyting above lowest available level will just add cycles and i have the lowest of the lowest celeron in all but the game pc (cos that wouldnt really work out on windows) ... and all these i want to cram onto a vocore with an old 64mb (yes, megabyte) sd card i still have around , just ... because, i dont think i'll be trying to sell myself anytime soon hahah
i hate the spotlight

you got it. they call it progress imagine windows 3.1 was 4MB, win95 60MB, Linux Walnut Creek 32bit Edition 30MB They ran on a IBM486- 66mhz with 4MB ram and a 200MB hard drive on a star network using coaxial BNC for thinwire networking. what can i say except i love my old stuff too.
auithin.jpg

Loading...

looks like @thundercurator came through :) thanks man, much appreciated , allow me to try again on another post then

Coin Marketplace

STEEM 0.19
TRX 0.16
JST 0.029
BTC 63491.17
ETH 2618.75
USDT 1.00
SBD 2.79