What is Nostr?
fiatjaf /
npub180c…h6w6
2024-09-26 18:52:10
in reply to nevent1q…2e93

fiatjaf on Nostr: #!/usr/bin/env fish set next (head -n 1 _next_frame) echo "[eng] publishing frame ...

#!/usr/bin/env fish

set next (head -n 1 _next_frame)
echo "[eng] publishing frame $next"

# upload the image
set url (satellite-upload --sec $SECRET_KEY --base-name 'noi-' $next.png)

# format the timestamp
set minute (jq -n "$next / 60 | floor | . % 60" | string pad -w 2 -c 0)
set second (jq -n "$next % 60" | string pad -w 2 -c 0)
set timestamp "$(echo -n $minute)min$(echo -n $second)s"

# publish the event
set content "$timestamp
$url"
set event (nak event --sec $SECRET_KEY -k 1 -c $content $RELAY)

# print reference
set nevent (nak encode nevent -r $RELAY -a (nak key public $SECRET_KEY) (echo $event | jq -r .id))
echo "[eng] https://njump.me/$nevent";

# increase count for the next run
set next (echo $next | jq 'tonumber | . + 1' | string pad -w 4 -c 0)
echo "[eng] next is $next"
echo $next > _next_frame

# update picture
nak event --sec $SECRET_KEY -k 0 -c "{\"name\":\"emperor's new groove\",\"about\":\"we are playing the entire thing\",\"picture\":\"$url\"}" $RELAY purplepag.es relay.damus.io nos.lol relay.nos.social user.kindpag.es
Author Public Key
npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6