Incoming Transactions - quick fix hack type
(I dont use it since i probably would be a criminal for doing even that without a license as its gambling in the enlightened state where i live)
You know and corrupting the children and what not ...
As @gmdatacenter will be busy solely checking confirmations for the game and @goldmanmorgan (which is one item in fact) - like the people in my head form me more or less and its the only team i can work with after so much damage.
I'll just drop it here - im barely posting anyway
so
#!/bin/bash
##################################
ACCOUNTHANDLE="ubasti"
ACCOUNTURI="@$ACCOUNTHANDLE"
##################################
#rm stuff here
##################################
source ../include/paths.inc
source "$INCLUDEDIR"getacctvars.inc
source "$INCLUDEDIR"composemainbody.inc
##################################
getactvars $ACCOUNTHANDLE
lastxnr=$(cat lastxnr)
LASTROOTPOST=$(curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_accounts", "params":[["ubasti"]], "id":1}' https://api.steemit.com | jq -r '.result | .[].last_root_post')
curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_account_history", "params":["ubasti", 100000, 500], "id":1}' https://api.steemit.com |jq '.'|grep -B15 -A 1 '"title": "Mister Tritons Microjackpot' >hist500x
lastpost_tx_nr=$(head -n1 hist500x|tr -cd '[:digit:]')
echo $lastpost_tx_nr
echo $lastxnr
diff=$((lastxnr - lastpost_tx_nr))
echo $diff
CURLURL='{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["'$ACCOUNTHANDLE'", 100000, '"$diff"'], "id": 1 }'
curl -s --data "$CURLURL" https://api.steemit.com |jq -c '.result | .[]' |grep '"transfer",'>"$ACCOUNTHANDLE"histsince
totaltrans=$(grep -c '"transfer",' "$ACCOUNTHANDLE"histsince)
grep '"to":"ubasti"' "$ACCOUNTHANDLE"histsince >"$ACCOUNTHANDLE"inctrans
inctrans=$(grep -c '"to":"ubasti"' "$ACCOUNTHANDLE"histsince)
validentries=$(grep -c ',"to":"ubasti","amount":"0.005 SBD","memo":' "$ACCOUNTHANDLE"inctrans)
##################################
cat > ubastitxt <<EOF
<hr>
https://youtu.be/hC7TNkwlLsI
<hr>
Simple setup : this should work even when raped by steemcleaners :
- send 0.005 sbd with or without memo to make an entry
- winner picked every sunday
- entries on the last day might be filed on the next week depending on how close
- setup will be to post once a week on sunday midnight
<hr>
<br>
transactions since last post : $diff
total transfers since last post : $totaltrans
total incoming transfers since last post : $inctrans
number of valid entries : $validentries
(non-valid incoming transactions will be checked, if its not advertising but a wrong amount the sbd will be returned as is)
total entries : 0
total sbd to win : 0
winner : none
<hr>
remember : gambling is DREUGHS ! but here you don't need to login to an external site, no keys are asked and you get only one entry per account per week
also keep in mind : there's no checking if you use multiple accounts but as its totally random if you have 10 entries and someone else wins you lose ten times 0.005
<hr>
keep an eye on @rudyardcatling for developments on any of the accounts, mostly the game or choon
check out
choon : alleycat
flixxo : rudyardcatling
steemit : @tyrnannoght (in dev-finite)
<hr>
https://cdn.steemitimages.com/DQmPtv2WehFzJA9RHvLak2fEN2JZDeCfmSTCdrzLWEvQ646/pdl.png
<center>*don't feed the trolls</center>
<hr>
<sub><sub>generated at $(date -u)</sub></sub>
EOF
cp ubastitxt "$READYDIR"ubastitxt
cp ubastitxt $HOME/PYthoncat/
basically what this does is get all transactions since the last post made on the account (all the way on top) and check for incoming and then check if its the exact right amount asked for
then generate a text using all variables provided, copy it to a folder where it can be posted using some basic Pythonscript to post posts
some would call it a bot but i think "bot" is more something you sell for 1800 dollar or what not ...
its just a shell script
the part you would need to extract and mod would be
LASTROOTPOST=$(curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_accounts", "params":[["ubasti"]], "id":1}' https://api.steemit.com | jq -r '.result | .[].last_root_post')
curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_account_history", "params":["ubasti", 100000, 500], "id":1}' https://api.steemit.com |jq '.'|grep -B15 -A 1 '"title": "Mister Tritons Microjackpot' >hist500x
lastpost_tx_nr=$(head -n1 hist500x|tr -cd '[:digit:]')
echo $lastpost_tx_nr
echo $lastxnr
diff=$((lastxnr - lastpost_tx_nr))
echo $diff
CURLURL='{"jsonrpc": "2.0", "method": "condenser_api.get_account_history", "params": ["'$ACCOUNTHANDLE'", 100000, '"$diff"'], "id": 1 }'
curl -s --data "$CURLURL" https://api.steemit.com |jq -c '.result | .[]' |grep '"transfer",'>"$ACCOUNTHANDLE"histsince
totaltrans=$(grep -c '"transfer",' "$ACCOUNTHANDLE"histsince)
grep '"to":"ubasti"' "$ACCOUNTHANDLE"histsince >"$ACCOUNTHANDLE"inctrans
inctrans=$(grep -c '"to":"ubasti"' "$ACCOUNTHANDLE"histsince)
validentries=$(grep -c ',"to":"ubasti","amount":"0.005 SBD","memo":' "$ACCOUNTHANDLE"inctrans)
where you can check the actual entries if you grep to a file or something from totaltrans / inctrans / validentries variables
now this is pure shell script which is probably the fastest yet least readable if you use something like
euh what was that
json_decode emm ...
JQ
sudo apt install jq
things get a lot more readable but be warned : using jq in linux isnt as easy as doing it in php or json.parse with jquery - its a lot of | [ ] $ > < ... ( and stuff)
this worked, i tested it before not using it (hahahlol enz...) but it does give some weird number on transactions like i get tx number 900 for the post one time and 901 for the post next time
since i didnt use it i didnt check if i can simply get the unique txID in a sequential file and since they split up condenser and steemit wallet is separate site by now
things might have changed :)
but since someone asked
...
gud ... that's two posts this week , im rollin! yee-haw !