Last active
January 2, 2016 21:19
-
-
Save lg3bass/8362336 to your computer and use it in GitHub Desktop.
Using CURL + GREP to get a link out of a webpage
This file contains 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
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