# 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 31
# self = https://watcher.sour.is/conv/mjcdeaq
can I post on yarn through curl?
@stigatle Yes 😆
@stigatle Yes 😆
@stigatle Yes 😆
@stigatle Yes 😆
@prologic do you have an example somewhere? want to tinker a bit and use libcurl for it
@stigatle I'll write one up 👌
@stigatle I'll write one up 👌
@stigatle I'll write one up 👌
@stigatle I'll write one up 👌
To securely login and authenticate to the API and set YARND_TOKEN env var for later use:


IFS= read -rsp 'Password: ' password; payload="$(jq -cnr --arg password "$password" '{username: "admin", "password": $password}')"; export YARND_TOKEN="$(curl -s -d "$payload" http://localhost:8000/api/v1/auth | jq -r '.token')"
To securely login and authenticate to the API and set YARND_TOKEN env var for later use:


IFS= read -rsp 'Password: ' password; payload="$(jq -cnr --arg password "$password" '{username: "admin", "password": $password}')"; export YARND_TOKEN="$(curl -s -d "$payload" http://localhost:8000/api/v1/auth | jq -r '.token')"
To securely login and authenticate to the API and set YARND_TOKEN env var for later use:


IFS= read -rsp 'Password: ' password; payload="$(jq -cnr --arg password "$password" '{username: "admin", "password": $password}')"; export YARND_TOKEN="$(curl -s -d "$payload" http://localhost:8000/api/v1/auth | jq -r '.token')"
To securely login and authenticate to the API and set YARND_TOKEN env var for later use:


IFS= read -rsp 'Password: ' password; payload="$(jq -cnr --arg password "$password" '{username: "admin", "password": $password}')"; export YARND_TOKEN="$(curl -s -d "$payload" http://localhost:8000/api/v1/auth | jq -r '.token')"


To verify that you are logged in and authenticated:


curl -s -d '' -H "Token: $YARND_TOKEN" http://localhost:8000/api/v1/whoami


To verify that you are logged in and authenticated:


curl -s -d '' -H "Token: $YARND_TOKEN" http://localhost:8000/api/v1/whoami


To verify that you are logged in and authenticated:


curl -s -d '' -H "Token: $YARND_TOKEN" http://localhost:8000/api/v1/whoami


To verify that you are logged in and authenticated:


curl -s -d '' -H "Token: $YARND_TOKEN" http://localhost:8000/api/v1/whoami


To verify the API endpoint(s) are working (no authentication required):


curl -s http://localhost:8000/api/v1/ping


To verify the API endpoint(s) are working (no authentication required):


curl -s http://localhost:8000/api/v1/ping


To verify the API endpoint(s) are working (no authentication required):


curl -s http://localhost:8000/api/v1/ping


To verify the API endpoint(s) are working (no authentication required):


curl -s http://localhost:8000/api/v1/ping


And finally to make a post:


curl -s -d '{"text": "Hello World!"}' -H "Token: $YARND_TOKEN" http://localhost:8000/api/v1/post | jq '.'


And finally to make a post:


curl -s -d '{"text": "Hello World!"}' -H "Token: $YARND_TOKEN" http://localhost:8000/api/v1/post | jq '.'


And finally to make a post:


curl -s -d '{"text": "Hello World!"}' -H "Token: $YARND_TOKEN" http://localhost:8000/api/v1/post | jq '.'


And finally to make a post:


curl -s -d '{"text": "Hello World!"}' -H "Token: $YARND_TOKEN" http://localhost:8000/api/v1/post | jq '.'
@prologic thank you so much!
perfect for what I needed.
@stigatle No worries 👌
@stigatle No worries 👌
@stigatle No worries 👌
@stigatle No worries 👌