-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: nostr
action: blob
revision:
path_from: nostr-filter.sh
revision_from: refs/heads/master:
path_to:
revision_to:

git.thebackupbox.net

nostr

git://git.thebackupbox.net/nostr

blob of:

nostr

/ nostr-filter.sh

refs/heads/master:/nostr-filter.sh
 #!/usr/bin/env bash
 logger -p crit "nostr-filter.sh: filter: $1"

 filter="$1"

 ids="$(jq -rc '.ids//""' <<< "$filter")" # may be prefixes
 authors="$(jq -rc '.authors//""' <<< "$filter")" # may be prefixes
 kinds="$(jq -rc '.kinds//""' <<< "$filter")" #TODO: sanitize this to only integers

 #e="$(jq -cr '.#e' <<< "$@")"
 #p="$(jq -cr '.#p' <<< "$@")"
 #since=
 #until=
 ### limit not being used in here.
 limit=

 ### only filtering based on kind atm
 if [ "$kinds" ];then jq --unbuffered -cn 'inputs | select( [.[2].kind] | inside('"${kinds}"') )';else stdbuf -oL cat;fi \
   | if [ "$authors" ];then jq --unbuffered -cn 'inputs | select( [.[2].pubkey] | inside('"${authors}"') )';else stdbuf -oL cat;fi \
   | if [ "$ids" ];then jq --unbuffered -cn 'inputs | select( [.[2].id] | inside('"${ids}"') )';else stdbuf -oL cat;fi

 #jq -cr 'inputs | select( .[1].pubkey == "c85f8bfef1526e16106075077078f7b2fc11084fc168aed15c6367f4697c44" )'

-- Response ended

-- Page fetched on Sun Jun 2 17:10:02 2024