Skip to content

Instantly share code, notes, and snippets.

@NightMachinery
Last active May 16, 2020 12:50
Show Gist options
  • Save NightMachinery/6ded66fa61ebc566e1bac5ef3d9d0c3e to your computer and use it in GitHub Desktop.
Save NightMachinery/6ded66fa61ebc566e1bac5ef3d9d0c3e to your computer and use it in GitHub Desktop.
Notifies you when a book has become available on Libgen.
#!/usr/bin/env zsh
#Install libgen.py, GNU Timeout, and terminal-notifier (macOS only. Just delete the line for other OSes.). Use cron to check for a book regularly. (e.g., `0 9 * * * ~/book-notifier.zsh "little schemer"`)
gtimeout 6s libgen -s "$1" &> /dev/null
if [ $? -eq 124 ]; then
terminal-notifier -message "$1" -title "Book Has Become Available!"
echo "$1 is now available!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment