uxCATling - rudimentary, dear Watson, parsing account history with nothing but that bash and dash - parseaccounthistory v0.00steemCreated with Sketch.

in #rudyardcatling6 years ago (edited)

(its cheating, i use curl ... du-uh)

well its not github and i'm not really trying to educate although if anyone gets anything from anything i say i guess thats a nice bonus. It's just my journey as i dive nose first below the surface. I forgot
in the underground is where the shadows are
ever felt impressed by those leet geeks ? well don't , its what they do every day all day, thats like being impressed by an athlete who does nothing but jump fences all day , cos you don't

well i was running short on post and i don't waste my photo albums on creating 2 hour writing in the making posts because wether you do or don't , if you don't feed the whale it remains basically a lottery

so i do what i like

https://steemit.com/introduction/@rudyardcatling/signature-post-20180501

and what keeps me busy, even if that means 10 minutes at a desk, running downstairs to dish a plate and dry a mug, coming back up for five, going down , eat a sandwich, come up, play five minutes of dark souls, sit at the desk another 5 praying to the 1e100 (someone recently was like O YOU MEAN GOOGGEL ING yeeeeeess, i dooooo ... i wonder who's the geek here and who's phoneboy the shiney

but well, we don't come to flame do we, i don't come to educate and the ultimate goal is best kept in the mist because it might never arrive so on my nosediving session into this chaotic mess called STEEMIT i was like OMG i need an easy way to check how many shares i have pushed to @steembasicincome (who i support not just out of mutual self-intrest btw) @steembasicincome = good for you if you like to share and are not under the pretense that we are not all here to advance ourselves in the meantime ... but that's not how they will put it, but they put it well, and they're very addressable people

and i was gonna talk about


#!/bin/bash

##################################
ACCOUNTHANDLE=$1
##################################
echo $ACCOUNTHANDLE

#ACCOUNTHANDLE="$ACCOUNTHANDLE.json"
bla='{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["'
bla2='",  10000, 10000], "id": 1 }'
bla3=$bla$ACCOUNTHANDLE$bla2

echo $bla3
#DOMAIN='https://steemit.com/'
#CURLURL="$DOMAIN$ACCOUNTHANDLE"
#https://stackoverflow.com/questions/19274127/how-do-you-grep-a-file-and-get-the-next-5-lines
#gets first record only
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", 0, 0], "id": 1 }' https://api.steemit.com >testest
#gets second record only
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", 1, 0], "id": 1 }' https://api.steemit.com >testest
#gets third record only ? 0,1 gives "start must be greater than limit" ... like uh ?
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", 2, 0], "id": 1 }' https://api.steemit.com >testest
#gets the first two ?
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", 2, 1], "id": 1 }' https://api.steemit.com >testest
#euhm gets tx 10000? this start must be greater than limit thing ? so 10000 is start ? and 1 is limit ? 
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", 10000, 1], "id": 1 }' https://api.steemit.com >testest
#get tx 20000 or last ? at time of write thats the last one i made ...
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", 20000, 1], "id": 1 }' https://api.steemit.com >testest
#gets the final 2 from top?
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", -1, 1], "id": 1 }' https://api.steemit.com >testest
#gets the latest entry ?
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", -1, 0], "id": 1 }' https://api.steemit.com >testest
#get the final 20 , but bottom up ?? ? ? something wront with pretty_please bc testestt only has 2 entries and lots of empty lines
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", -1, 20], "id": 1 }' https://api.steemit.com >testest
#limit must be 10000 or smaller
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", 100000, 10001], "id": 1 }' https://api.steemit.com >testest
#get last tx by starting at ridiculous high ? *nod*
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", 1000000000, 0], "id": 1 }' https://api.steemit.com >testest
#does that mean theres a max number of tx ? uhuh , parse error
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", 10000000000000000000000000, 0], "id": 1 }' https://api.steemit.com >testest
#mhm so atm of this last tx is #9560 , soon will need two loads combined if max=10k
#so get last txid first in var then parse by blocks of 10k ? mhm ?
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling", 1000000000, 10000], "id": 1 }' https://api.steemit.com >testest
#yah parse in blocks of 10k, append to file, cat that should do it pff i'll have to pray to the 1e100 for loops in bash lolomg yawn REFUSE sleep is not now
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["rudyardcatling",  10000, 10000], "id": 1 }' https://api.steemit.com >testest
#curl --silent --data '{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["${ACCOUNTHANDLE}",  10000, 10000], "id": 1 }' https://api.steemit.com >testest
curl --silent --data "$bla3" https://api.steemit.com >testest
##########################################
#so these arent really needed anymore
#cat testest |./pretty_please.sh >testestt
#cat testestt | grep -C 7 '"to":"steembasicincome",' >testesttt
##########################################
grep -Po '(?<=("to":"steembasicincome",)).*?(?=(}))' testest > testestttt
cat testestttt



how i'm not generation phoneboy ?

no, how i spent all night figuring with my chaotic quantum entangled dendrites (thanks guys, youve been a great help ... assuming you answered since i didnt check yet ...)

it actually boils down to under five lines or so but if your not into #linux and you're not into futile homegrown systems for teh lulz it will not speak to you anyway, otherwise im sure you can distill the few lines that arent hashed out.

It's rudimentary but it gets me what i want now at v0.00 , it gets me from all account transactions all shares i pushed to @steembasicincome in a nice list in the terminal

now there's a catch ofourse, the limit seems to be 10.000 , i was a bit confused with the start and limit errors, and then the out of margin-type stuff, but i assume that's to prevent easy dossing or something.

Thing is : this gets me what i want right now and can be used as a command in "the bigger script"-to-rule-them-all

at rudimentary levels but it taught me a lot

if i get over 10.000 transactions i will have to parse the whole shebang in blocks of 10k , then append the output to the final file, which cant be hard once i pray to the 1e100 what the syntax is for iteration in bash lol

i tend not to remember because for some reason i feel syntax is a waste of brainspace and programming logic is what it is, no matter what fancy name or subclass your fav lingo has : it's all von neumann logic

so, enter the qubit ... but first we need to solve the carry bit, where does the carry bit hide when 1+1 becomes 0 ?

is the carry bit actually

the QUBIT

well no probably not and not relevant either
so

basically euhmmm ... what was i gonna say again ?

i need an aide or something, O YEA, a few conclusions but basically this little bit boils down to about five lines of code , has terminal input for the account name and can as far as i can see be used to parse about anything from account data if i just add $2 , not bad for a force of chaos if i say so myself (allow me a little ego , wullya?)


the conclusion, is somewhat more dire

because of these snippets i have sifted through many a dump from many a json regarding the steemit thing here and i see there's an upper limit to transactions ...
i dont know if there's an upper limit to transactions BUT , considering there was from the start an upper limit to the amount of BTC when godamoto created the new world, its very possible well possible there is and it dawns

"teh spemz" , its not about fat fish ranting they want to be entertained ... it's about what happens if accounts go over the hundreds of billions ?
has anyone ran a simulation of that ? does anyone know that ? is this a hardcoded upper limit OR is this just an ceiling for the poking (i have no workfloor jargon, it changes EVERY fucking five years, precious, that's semantics, not facts)

see i can imagine its like you dont NEED to call for more than the GOOGOLeth transaction on one account (slight exaggeration probably) because you wont have that in a lifetime but bots are immortal, right ?

ah, $2 ? thats not 2 dollar, that's the second command line variable if you like if you run a script and pass parameters in linux they're numbered hardcoded $1, $2 etc , and you can substitute the values basically anywhere in the code because thats

how nice linux is

yay Torvalds (another one of the gods of the new world but a bit more public then and he'll deny it i'm sure)

so i'll be asking around how this is and people will be like "euh, dunno ... " and others like "STFU NUB RTFM" and others like "........." thats what you get in open bubble universe communities but slowly since i am Random of Amber from the chaos it will be clear somehow

so you need to parse it in blocks of 10k if you use these curl methods provided, and the upper limit is something i havent tested YET

but it does what i wanted and i think thats great for a chaotic piece of garbled like me

its re-usable, modifiable, usable, and can in the end provide a whole instruction set for what i actually would like to have

so

YAY me, and sorry if you didnt get any of this, i didnt either but i kept on poking til i did


other wip :


it WILL come together if #fuckflanders doesnt fuck it but this is how it rolls, im always up for something on my discuss thing i keep somewhere and check once a day but i'll put the things and things on mega or something in case anyone

they dont require elevated privileges unless you run as root it would be hard to make them break stuff


(i dont own the premonist etc ... but i could tell you, if you fancy a career in it, you better be doing it for free at home too)

ah : disclaimer 1 && 2 :

  • if you edit posts you will not only add to the payout but unless they keep a separate temp server every time you do its a transaction on the chain (which is something i would strongly recommend CHANGING since you can edit your posts anyway, to keep a transaction for something thats not final seems like ... let's call it folly)

  • and euhm ... euhm .. O YA ! linux is not a programming language, it's an OS, but actually at the bare roots, you dont need any programming language anything above that lvl 1 or 2 bash scripting eats more cycles than it has to but i agree opcodes is a bit passé hahaa lol, im not a python type of guy and i have found no reason for it to exist yet other than people with dyslexia (this is the part where i'm cocky and need to be punished by phoneboy)

the short version boils down to

ACCOUNTHANDLE=$1
bla='{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["'
bla2='",  10000, 10000], "id": 1 }'
bla3=$bla$ACCOUNTHANDLE$bla2
curl --silent --data "$bla3" https://api.steemit.com >testest
cat testest | grep -Po '(?<=("to":"steembasicincome",)).*?(?=(}))'

which is definitely not the shortest base linux can handle, and the first is just a dump of whatever i was testing and i feel not the need to apologize but to clarify :: you would use the output of this, as you use this as a command in the big picture, to pass on the the next 'line of command'

piping , streaming

its a wonderful OS, sadly windows has directx11, 12 and the next

well the amount of tortilla flaps amazes me too still but, they said i could have the same bill for more tortilla flaps and extra mayo SO

im still figuring out how this is bad for me because i have never seen a marketing scheme favouring the buyer

something must be wrong

tschmmm ... well asking back is not what i do, neither is giving when asked

i do give one alm every time im in brussels but thats not cuz imma mislum

thats just cuzz

if you are waiting for me to ASK you to whatever, you're gonna grow old before you grow wise

if you WANT TO then do it, otherwise find something you WANT to

i'm not a dog

thats NEVER gonna happen

i ask for nothing in return but when i dont no one gets to expect anything either

i'm a very simple man

Sort:  

Hey @rudyardcatling,
Your post "uxCATling - rudimentary, dear Watson, parsing account history with nothing but that bash and dash - parseaccounthistory v0.00" hast just been resteemed !!!.😝🙂😝
I've done this for following me..


😄😻😄 If you want's to stop me, Please Unfollow @tow-heed😄😻😄

do continue, i dont even wanna remove your ad at that price cooltext263015534343913.png

Coin Marketplace

STEEM 0.35
TRX 0.12
JST 0.040
BTC 70455.47
ETH 3561.82
USDT 1.00
SBD 4.71