Skip to content

Instantly share code, notes, and snippets.

@cbilson
Forked from shirishp/infoq.sh
Last active December 27, 2015 07:59
Show Gist options
  • Save cbilson/7293470 to your computer and use it in GitHub Desktop.
Save cbilson/7293470 to your computer and use it in GitHub Desktop.
#! /bin/bash
# Original Author: Shirish Padalkar (https://twitter.com/_Garbage_)
if [ "$#" -ne 1 ]; then
echo "Usage: $0 infoq_presentation_url"
exit 1
fi
url_with_spaces=`curl -silent -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" $1 | grep "<source src=" | tr -dc "[:print:]"`
url=${url_with_spaces/<source src=[\"\']} |100 73723 0 73723 0 0 82679 0 --:--:-- --:--:-- --:--:-- 82649
url=${url/[\"\'] \/>}
curl -O $url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment