summaryrefslogtreecommitdiff
path: root/bin/extra/myalscore.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/extra/myalscore.sh')
-rwxr-xr-xbin/extra/myalscore.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/extra/myalscore.sh b/bin/extra/myalscore.sh
new file mode 100755
index 0000000..ef68bcc
--- /dev/null
+++ b/bin/extra/myalscore.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+[ "$1" ] || exit 1
+query="$(printf '%s' "$*" | sed 's/\s/%20/g')"
+curl -s "https://myanimelist.net/search/prefix.json?type=all&keyword=$query&v=1" \
+ -H 'Accept: application/json, text/javascript, */*; q=0.01' |
+ jq -r '.categories[].items[] | [.payload.score, .name] | join(" ")'