-
-
Save rafacv/3909442 to your computer and use it in GitHub Desktop.
Search Skype history for given terms
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
| #!/bin/bash | |
| usage() { | |
| echo "usage: skype-search username term [...]" | |
| } | |
| join() { | |
| local params="" | |
| while [ ! -z $1 ]; do | |
| params="${params}%$1" | |
| shift | |
| done | |
| echo "${params}%" | |
| } | |
| search() { | |
| username=$1 | |
| shift | |
| query=$(join $@) | |
| sqlite3 $HOME/Library/Application\ Support/Skype/${username}/main.db "SELECT from_dispname, datetime(timestamp, 'unixepoch') AS date, body_xml FROM Messages WHERE body_xml LIKE '$query' ORDER BY timestamp;" | |
| } | |
| if [ $# -lt 2 ]; then | |
| usage | |
| exit 1 | |
| else | |
| search $@ | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
joinfunction is a lazy implementation of something awk would be better at.