debug and correct

This commit is contained in:
qo-op 2020-06-16 06:29:58 +02:00
parent 9c863fe4bd
commit afe4113ee0
3 changed files with 7 additions and 5 deletions

View File

@ -50,8 +50,9 @@ a u d i o
#messages=$(sbotc messagesByType '{"type":"post","gt":'$last_ts'}')
# SEARCH "#zenyta" CMD in message text
echo "sbotc backlinks.read '{\"query\":[{\"\$filter\":{\"dest\":\"#zenyta\",\"value\":{\"content\":{\"type\":\"post\"}},\"timestamp\":{\"\$gt\":'\"$last_ts\"'}}}]}'"
messages=$(sbotc backlinks.read '{"query":[{"$filter":{"dest":"#zenyta","value":{"content":{"type":"post"}},"timestamp":{"$gt":'"$last_ts"'}}}]}')
[[ $messages == "" ]] && messages=$(sbotc query.read '{"query":[{"$filter":{"value":{"author": "'"$WHOAMI"'", "content":{"type":"zenyta"}}}}]}')
[[ $messages == "" ]] && messages=$(sbotc query.read '{"query":[{"$filter":{"value":{"author": "'"$WHOAMI"'", "content":{"type":"zenyta"}}}}]}') && echo "sbotc query.read '{\"query\":[{\"\$filter\":{\"value\":{\"author\": \"'"$WHOAMI"'\", \"content\":{\"type\":\"zenyta\"}}}}]}'"
while read -r msg
do
# EXTRACT CMD PARAM
@ -60,7 +61,7 @@ do
timestamp=$(printf %s "$msg" | jq -r .value.timestamp)
# TEST CURRENT NODE last_ts
[[ $timestamp -lt $last_ts ]] && echo "ALREADY DONE" && continue
[[ $timestamp -lt $last_ts ]] && echo "$last_ts: ALREADY DONE $msg_key timestamp is $timestamp " && continue
# SWARM REFRESH
$MY_PATH/ipfs_SWARM_refresh.sh

View File

@ -33,7 +33,7 @@ ipfsnodeid=$(ipfs id -f='<id>\n')
current_ts=$(date -u +%s%N | cut -b1-13)
[ -s ~/.zen/zenytv.last.ts ] && last_ts=$(cat ~/.zen/zenytv.last.ts) || last_ts=$((current_ts - 24*3600*1000)) # 24h ago
last_ts=$((last_ts + 10))
# last_ts=$((last_ts + 10))
echo "Hi, i am [$self_name]($self)
last timestamp: $last_ts"
@ -49,6 +49,7 @@ __ __ (_) __| | ___ ___
#messages=$(sbotc messagesByType '{"type":"post","gt":'$last_ts'}')
# SEARCH "#zenytv" CMD in message text
echo "sbotc backlinks.read '{\"query\":[{\"\$filter\":{\"dest\":\"#zenytv\",\"value\":{\"content\":{\"type\":\"post\"}},\"timestamp\":{\"\$gt\":'\"$last_ts\"'}}}]}'"
messages=$(sbotc backlinks.read '{"query":[{"$filter":{"dest":"#zenytv","value":{"content":{"type":"post"}},"timestamp":{"$gt":'"$last_ts"'}}}]}')
[[ $messages == "" ]] && exit 1
while read -r msg
@ -59,7 +60,7 @@ do
timestamp=$(printf %s "$msg" | jq -r .value.timestamp)
# TEST CURRENT NODE last_ts
[[ $timestamp -lt $last_ts ]] && echo "ALREADY DONE $msg_key" && continue
[[ $timestamp -lt $last_ts ]] && echo "ALREADY DONE $msg_key timestamp is $timestamp " && continue
# SWARM REFRESH
$MY_PATH/ipfs_SWARM_refresh.sh

View File

@ -147,7 +147,7 @@ if [[ ! $(which silkaj) ]]; then
sudo apt install python3-pip python3-setuptools python3-wheel -y
pip3 install base58
pip3 install silkaj --user
echo 'PATH=$PATH:~/.local/bin' >> ~/.bashrc && source ~/.bashrc
echo 'PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc
fi
# INSTALL sbotc