Skip to content

Instantly share code, notes, and snippets.

@lg3bass
Last active January 2, 2016 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lg3bass/8362336 to your computer and use it in GitHub Desktop.
Save lg3bass/8362336 to your computer and use it in GitHub Desktop.
Using CURL + GREP to get a link out of a webpage
xxxxxxxx$ curl -s 'http://media.pearsoncmg.com/ph/hss/hss_manza_sociologyproject_1/applyingvideos/applying01.html' | grep -o 'script src="[^"]*"'
script src="http://mediaplayer.pearsoncmg.com/_ph_ssa3_cc_img_set.autoplay.false___set.width.768___set.height.432___embed.mytarget/ph/streaming/ssa/mysoclab/social_imagination/01_applying.m4v"
Unix command:
curl -s 'http://media.pearsoncmg.com/ph/hss/hss_manza_sociologyproject_1/applyingvideos/applying01.html' | grep -o 'script src="[^"]*"'
Result:
script src="http://mediaplayer.pearsoncmg.com/_ph_ssa3_cc_img_set.autoplay.false___set.width.768___set.height.432___embed.mytarget/ph/streaming/ssa/mysoclab/social_imagination/01_applying.m4v"
Source:
http://crunchbang.org/forums/viewtopic.php?pid=182976#p182976
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment