add support for registries #2

Merged
g1n merged 3 commits from r1k/twtxt-c:main into main 2021-07-08 15:44:23 +00:00
1 changed files with 17 additions and 1 deletions
Showing only changes of commit 7fd588170a - Show all commits

18
twtxt-c
View File

@ -26,7 +26,12 @@ Commands:
tweet Append a new tweet to your twtxt file.
unfollow Remove an existing source from your...
view Show feed of given source.
registry Show registers\n"
registry Show registers\n
reg list Show registers
reg add Add your twtxt to registry
reg users List users on the registry
"
}
case $1 in
-h | --help)
@ -45,6 +50,7 @@ case $1 in
read -p "URL to twtxt [https://example.com/twtxt.txt]: " url
url=${url:-"https://example.com/twtxt.txt"}
printf "[twtxt]\n nick = %s\n twtfile = %s\n url = %s\n" "$nick" "$path_to_twtxt" "$url" >> $config/config
printf "https://twtxt.envs.net/api/plain/\n https://twtxt.tilde.institute/api/plain/" > $config/registry
;;
tweet)
export config=/home/$USER/.config/twtxt-c/config
@ -55,4 +61,14 @@ case $1 in
;;
*)
printf "Work in progress\n" ;;
reg)
case $2 in
list | *)
cat /home/$USER/twtxt-c/registry
;;
add)
url=
curl -X POST 'https://twtxt.tilde.institute/api/plain/users?url=&nickname='
esac