#!/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

Reply to this note

Please Login to reply.

Discussion

This is the full code for running the thing, provided that you fill in the environment variables and run it from a folder that has all the images prepared, which you can do with some simple ffmpeg commands.

Thanks:)

I can't do any of that but I appreciate it. I like the idea:)

Someone make a version of this but for The X Files, or ...Lain, or True Detective... Or whatever... Something cool lol.

The sopranos one on twitter is actually p cool.

nostr:nevent1qqsqqqy0480qv8y2ynv9dh5jpzmw7m563ml4h47ls9k5c74q0wkj68cpr3mhxue69uhhyetvv9uju6rfva5xc6t8dp6x2u3wvdhk6tczyqalp33lewf5vdq847t6te0wvnags0gs0mu72kz8938tn24wlfze6qcyqqqqqqg305d5p