diff --git a/mikuru-timeline b/mikuru-timeline index d97eb4a..3e3c3b6 100755 --- a/mikuru-timeline +++ b/mikuru-timeline @@ -1,9 +1,10 @@ #!/bin/sh # That will have to do for now -! [ command -v curl ] && exit 1 -! [ command -v jq ] && exit 1 +HOST="$(sed -e 's/host = //' -e '/mikuru/d' -e '/token/d' ~/.config/mikuru.ini)" +TOKEN="$(sed 's/token = //' ~/.config/mikuru.ini | tail -n1)" -curl -H "Accept: application/json" -H "Content-Type: application/json" \ - -H "User-Agent: mikuru/timeline.sh" -H "Token: $(sed 's/token = //' ~/.config/mikuru.ini | tail -n1)" \ - -d '{"page": 1}' $(sed -e 's/host = //' -e "/mikuru/d" -e "/token/d" ~/.config/mikuru.ini)/api/v1/timeline | jq | less - +curl -s \ + -H "Accept: application/json" -H "Content-Type: application/json" \ + -H "User-Agent: mikuru/timeline.sh" -H "Token: ${TOKEN}" \ + -d '{"page": 1}' ${HOST}/api/v1/timeline \ + | jq ".twts"