Skip to content

Instantly share code, notes, and snippets.

@vadimkantorov
Created September 7, 2016 16:01
Show Gist options
  • Save vadimkantorov/30d79a5dcbb48d1e38fccc7a736db49d to your computer and use it in GitHub Desktop.
Save vadimkantorov/30d79a5dcbb48d1e38fccc7a736db49d to your computer and use it in GitHub Desktop.
A Bash script for extracting URLs from Facebook message archive file (messages.htm) for a given user name. The script will print most recent links first.
# Usage: bash urlgrepfb.sh "Vadim Kantorov" > urls.txt
cat messages.htm | xpath -q -e "//div[@class='thread' and contains(text(), '$1')]" | grep -o 'http[^ <]*' | tac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment