Quickly grab and copy HTML & CSS source to the clipboard with curl
This should be a helpful tip for the web developers out there. Using curl and pbcopy, we can quickly grab and copy HTML and CSS code from any URL via the command line.
Getting HTML is just a matter of pointing curl to the URL in question:
curl "http://google.com/" | pbcopy
The HTML will now be in your clipboard for you to paste anywhere else.
Grabbing the CSS requires you to specify where the CSS file is located, otherwise the command is the same:
curl "http://google.com/css/stylesheet.css" | pbcopy
We’ve covered pbcopy & pbpaste a while ago, they’re just command line interfaces for the Mac OS X clipboard but combined with other scripts or utilities can be quite powerful.