Skip to content

Commit

Permalink
Add GOODREADS script.
Browse files Browse the repository at this point in the history
  • Loading branch information
kraasch committed Feb 21, 2024
1 parent 276fd75 commit 300768f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ hub_update:
@hub_ctrl ${HUB_MODE} ln "$(realpath ./src/core/expand_globs_py)"
@hub_ctrl ${HUB_MODE} ln "$(realpath ./src/wrappers/git/git_commit_past)"
@hub_ctrl ${HUB_MODE} ln "$(realpath ./src/wrappers/misc/sxiv_rm)"
@hub_ctrl ${HUB_MODE} ln "$(realpath ./src/wrappers/curl/web_goodreads)"
9 changes: 9 additions & 0 deletions src/wrappers/curl/web_goodreads
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

search="$@"

search=$(echo "$search" | sed 's/ /%12/g')
addr='https://www.goodreads.com/search?utf8=✓&query='
full="${addr}${search}"

curl -s "$full" | grep -i 'minirating' | head -1 | grep '[^>]*avg' -o

0 comments on commit 300768f

Please sign in to comment.