Compare commits
No commits in common. "f790267a441f3542c05336791a22658a319a9a2c" and "0ce5af2bc4513082508de4f69fa9bc2d14ab1cff" have entirely different histories.
f790267a44
...
0ce5af2bc4
18
ratatoskr.sh
18
ratatoskr.sh
@ -232,7 +232,7 @@ done
|
|||||||
bgLoop=0
|
bgLoop=0
|
||||||
while : ; do
|
while : ; do
|
||||||
if [[ -n "${since_id}" ]]; then
|
if [[ -n "${since_id}" ]]; then
|
||||||
result="$(curl -sS --oauth2-bearer "${oauth_token}" "${instanceURL}/api/v1/timelines/${timeline:-home}" -d "since_id=${since_id}")"
|
result="$(curl -sS --oauth2-bearer "${oauth_token}" "${instanceURL}/api/va/timelines/${timeline:-home}?since_id=${since_id}")"
|
||||||
else
|
else
|
||||||
result="$(curl -sS --oauth2-bearer "${oauth_token}" "${instanceURL}/api/v1/timelines/${timeline:-home}")"
|
result="$(curl -sS --oauth2-bearer "${oauth_token}" "${instanceURL}/api/v1/timelines/${timeline:-home}")"
|
||||||
fi
|
fi
|
||||||
@ -255,18 +255,14 @@ while : ; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# process the response to get the latest event id
|
# process the response to get the latest event id
|
||||||
latest_id="$(jq -r '.[].id' <<< "$result")"
|
latest_id="$(jq -r '.data[0].id' <<< "$result")"
|
||||||
if [[ "${since_id}" != "${latest_id}" ]]; then
|
if [[ "${since_id}" != "${latest_id}" ]]; then
|
||||||
# handle new events
|
# handle new events
|
||||||
events="$(jq -r '.[].content' <<< "$result")"
|
events="$(jq -r '.data[] | "\(.account.username): \(.content)"' <<< "$result")"
|
||||||
stripped_events="$(echo "$events" | sed -E 's/<[^>]+>//g')"
|
echo -e "$events" | while read -r event; do
|
||||||
usernames="$(jq -r '.[].account.username' <<< "$result")"
|
echo "$event"
|
||||||
echo -e "$usernames" | while read -r username; do
|
|
||||||
echo "$username: $(echo "$stripped_events" | head -n 1)"
|
|
||||||
stripped_events="$(echo "$stripped_events" | tail -n +2)"
|
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
play_sound new_${timeline}
|
|
||||||
since_id="$latest_id"
|
since_id="$latest_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -277,7 +273,7 @@ done &
|
|||||||
# Handle commands
|
# Handle commands
|
||||||
while : ; do
|
while : ; do
|
||||||
# Command prompt:
|
# Command prompt:
|
||||||
read -er command
|
read -er -p "<${softwareName}> " command
|
||||||
if [[ ! "${command}" =~ ^/ ]]; then
|
if [[ ! "${command}" =~ ^/ ]]; then
|
||||||
post_status "${command}"
|
post_status "${command}"
|
||||||
continue
|
continue
|
||||||
@ -287,7 +283,7 @@ while : ; do
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Error: '${command}' is not a valid command."
|
systemMessage="Error: '${command}' is not a valid command."
|
||||||
play_sound error
|
play_sound error
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user