# I am the Watcher. I am your guide through this vast new twtiverse.
#
# Usage:
# https://watcher.sour.is/api/plain/users View list of users and latest twt date.
# https://watcher.sour.is/api/plain/twt View all twts.
# https://watcher.sour.is/api/plain/mentions?uri=:uri View all mentions for uri.
# https://watcher.sour.is/api/plain/conv/:hash View all twts for a conversation subject.
#
# Options:
# uri Filter to show a specific users twts.
# offset Start index for quey.
# limit Count of items to return (going back in time).
#
# twt range = 1 24
# self = https://watcher.sour.is/conv/zd4utgq
@prologic Regarding the new way of generating twt-hashes, to me it makes more sense to use tabs as separator instead of spaces, since the you can just copy/past a line directly from a twtxt-file that already go a tab between timestamp and message. But tabs might be hard to "type" when you are in a terminal, since it will activate autocomplete...🤔
Another thing, it seems that you sugget we only use the domain in the hash-creation and not the full path to the twtxt.txt
$ echo -e "https://example.com 2024-09-29T13:30:00Z Hello World!" | sha256sum - | awk '{ print $1 }' | base64 | head -c 12
@prologic Regarding the new way of generating twt-hashes, to me it makes more sense to use tabs as separator instead of spaces, since the you can just copy/past a line directly from a twtxt-file that already go a tab between timestamp and message. But tabs might be hard to "type" when you are in a terminal, since it will activate autocomplete...🤔
Another thing, it seems that you sugget we only use the domain in the hash-creation and not the full path to the twtxt.txt
$ echo -e "https://example.com 2024-09-29T13:30:00Z Hello World!" | sha256sum - | awk '{ print $1 }' | base64 | head -c 12
@prologic Regarding the new way of generating twt-hashes, to me it makes more sense to use tabs as separator instead of spaces, since the you can just copy/past a line directly from a twtxt-file that already go a tab between timestamp and message. But tabs might be hard to "type" when you are in a terminal, since it will activate autocomplete...🤔
Another thing, it seems that you sugget we only use the domain in the hash-creation and not the full path to the twtxt.txt
$ echo -e "https://example.com 2024-09-29T13:30:00Z Hello World!" | sha256sum - | awk '{ print $1 }' | base64 | head -c 12
@prologic Regarding the new way of generating twt-hashes, to me it makes more sense to use tabs as separator instead of spaces, since the you can just copy/past a line directly from a twtxt-file that already go a tab between timestamp and message. But tabs might be hard to "type" when you are in a terminal, since it will activate autocomplete...🤔
Another thing, it seems that you sugget we only use the domain in the hash-creation and not the full path to the twtxt.txt
$ echo -e "https://example.com 2024-09-29T13:30:00Z Hello World!" | sha256sum - | awk '{ print $1 }' | base64 | head -c 12
@sorenpeter a TAB is simply \t
. Just add it to that echo
line, and that's it.
@sorenpeter a TAB is simply \\t
. Just add it to that echo
line, and that's it.
Thanks @david, good to know, but we need to agree on what character we use, otherwise the hashes will not be the same:)
Thanks @david, good to know, but we need to agree on what character we use, otherwise the hashes will not be the same:)
Thanks @david, good to know, but we need to agree on what character we use, otherwise the hashes will not be the same:)
Thanks @david, good to know, but we need to agree on what character we use, otherwise the hashes will not be the same:)
@sorenpeter oh, I thought we were settled on TABs for a while now, weren't we? 🤔 The new website mentions TABs too. The command echo -e
(on any shell?) will use \\t
for them.
@sorenpeter oh, I thought we were settled on TABs for a while now, weren't we? 🤔 The new website mentions TABs too. The command echo -e
(on any shell?) will use \t
for them.
PHP uses \\t
as well for TABs.
PHP uses \t
as well for TABs.
@prologic I think printf is a more portable option than echo -e for interpreting \t as tab. E.g. printf '%s\t%s\t%s' "$url" "$time" "$text". In general I always prefer printf over echo for anything non-trivial in unix shell scripts. See last paragraph of https://en.wikipedia.org/wiki/Echo_(command)#History
@prologic I think printf is a more portable option than echo -e for interpreting \\t as tab. E.g. printf '%s\\t%s\\t%s' "$url" "$time" "$text". In general I always prefer printf over echo for anything non-trivial in unix shell scripts. See last paragraph of https://en.wikipedia.org/wiki/Echo_(command)#History
Btw anyone can put up PR(s) 🙃
Btw anyone can put up PR(s) 🙃