getting a post markup bit for storage using basic shell onlysteemCreated with Sketch.

in steemit •  6 years ago 
As i was kept awake this morning after suddenly getting the urge to try this , after @mytechtrail told me about @holger80 's fine blog after i asked around for anyone who could potentially give me a simple working example on how to make a *transaction* on steem using curl only i ended up digging out half of stackoverflow and it was 9:30 in the morning before i knew it

i don't consider myself a pro (or an artist for that matter) but ive written a line or two, tuned a tune and a few toons too , the only question was "does it work with / in the textbody and

#!/bin/bash
#######################
#runs on linux mint 19 without additional packages
#######################
ACCOUNT="tyrnannoght"
#######################
C1='{"jsonrpc":"2.0", "method":"condenser_api.get_blog_entries", "params":["'
START_ENTRY="0"
LIMIT="100"
C2='"'",$START_ENTRY,$LIMIT"
C3='], "id":1}'
NODE='https://api.steemit.com'
CURLURL="$C1$ACCOUNT$C2$C3"
#get LIMIT number of posts starting from top (root_posts only)
curl --data "$CURLURL" "$NODE" |tr '}' "\n" |grep '"reblog_on":"1970-01-01T00'|grep -Po '(?<=(mlink":")).*?(?=("))' > permlinks
#get most recent entry
LASTPOST=$(cat permlinks|head -n1)
#get body/content
C1='{"jsonrpc":"2.0", "method":"condenser_api.get_content", "params":["'
C2='", "'
C3='"], "id":1}'
CURLURL="$C1$ACCOUNT$C2$LASTPOST$C3"
curl -s --data "$CURLURL" "$NODE" >tempcontent

#im not 100% sure this covers everything actually :D
STRINGY=$(grep -Po '(?<=(","body":")).*?(?=(","json_metadata":"{))' tempcontent)
STRINGY2=$(echo "${STRINGY@E}")
STRINGY3="${STRINGY2//\\\///}"
echo "${STRINGY3@E}"
#i didnt test in case of an actual \/ in the textbody ... :D but it should run without any packages or extra overhead installed (should)

i just made a post on @maahes b/c i seem to have more RC available than posts lately there so i'm upping the count again for more distros (for whatever they're still worth these days) and put in the characters and

Screenshot from 2019-01-05 13-26-32.png

from all i can see, it works :)

which still just leaves me with the question : "how do i make a transaction on steem using curl and standard linux shell only"

something no one has been willing to show me up until today (mostly because most people don't know) and in steemdevs i got the RTFM treatment once so me being me that means nie wieder (as i'm not l33T enough now, so i definitely won't be later ...)

if you can fill in the dots , there's plenty on this script you could use

i'm sure it will make me two cents in my non-hot-and-trending-section without python for hipsters (no offense but i think the hype's too much , its just a "thing" really, and i wonder with the up and coming new lingo from M.I.T. what will be left of it in three years so if anything at all its not worth my time and effort no matter how i look at it.

Mostly because it creates an extra layer, uses more resources (cpu + mem) than using simply what's already available. If i had any REAL skill id probably try ASM to keep it close as possible , no arrays , just stream data in memory as linux streams everything around the way it already does, which already removes the extra time it take to store it all in easily readable formats, which

in my laymans opinion

would still be the way to go about supercomputers , NOT to create an extra language that layers it to run virtual machines on it. No, sir ,no madam you can NOT convince me that thing will process as fast running a 2nd or 3rd level scripted (even if partially compiled) language in a virtual machine

you can't ... if its about ease i think your geniusses should alter their titles

as i dont claim to be one i can just be me :D

grepCat.png

cathublogo.png

thanks @mytechtrail for the "thought experiment" i know that's probably not the intention but i learned a bit or two on shell i didnt know ...

the string substitution is might, for mighty it is !

yolo, now please upvote to 5000 so i can be free and think more of this and less about where next week will come from to hit me in the face

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:  

btw @mytechtrail ...

https://www.linux.com/blog/2019/1/linux-hacker-board-trends-2018-and-beyond

probably the kind of reading you like :p for when you're settled

Thanks, I will give it a read.

which is not an attack on anyone but merely what kept me awake this morning combined with my "i just woke up"-opinion ... thought it would be a waste not to post it ...

@rudyardcatling, I find that asking a question if even not 100% relevant to the topic often causes a "thought experiment" (like the phrase) and often gives those involved a push in the correct direction.

well yes , @mytechtrail ... i do prefer constructive over always-positive lol, sometimes life just ain't fixed by wearing a fake smile but in-here between the cables and the numbers i can find refuge now and then. I used to be a bit (make that a byte or a gig lol) more outgoing but, excrement in happens usually in ascending sequence .

I hope your grand movement exodus is going without hiccups

another thing i find, planning ahead too far is like "asking for it" lol as entropy will get you by the time your seven days from now like that ... too much Beckett maybe or just my mudpits european view as it was born ... ttyl