aboutsummaryrefslogtreecommitdiff
path: root/src/character_command.sh
blob: 7f2be399cbf3115e0b8227bdb06cdd784c83680e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
NAME=$(array_to_string "${args[name]}")

# Obtain media IDs from AniList
ID=$(curl 'https://graphql.anilist.co/' \
	--silent \
	--request POST \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data "{ \"query\": \"{ Character(search: \\\"${NAME}\\\") \
    { id } }\" }")

xdg-open https://anilist.co/character/"$(echo "${ID}" |
	jq '.data.Character.id' || true)"