Last active
August 29, 2015 14:07
-
-
Save pjaspers/eb075748a692ff610e7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Helper functions to interact with the DB of [gifwit](http://gifwit.com) | |
function gifcount() { | |
COUNT=$(gifme | wc -l) | |
echo "Current number of gifs: ${COUNT}" | |
} | |
# Usage: `gifme cats` | |
function gifme() { | |
db="${HOME}/Library/Containers/stevesmith.gifwit/Data/Library/Application Support/stevesmith.gifwitfiles/gifwit.storedata" | |
query="select ZURL, ZKEYWORDS from ZIMAGE where ZKEYWORDS LIKE '%$1%';" | |
/usr/bin/sqlite3 $db $query | awk '{split($0,a,"|"); printf "\033[1;31m%-20s\033[0m: %s\n",a[2],a[1]}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment