Last active
November 2, 2024 17:00
-
-
Save michenriksen/7430125 to your computer and use it in GitHub Desktop.
Simple function to view the source code of a web page in a terminal with syntax highlighting. Very convenient for checking out potentially malicious websites before rendering them in a browser. [Pygments](http://pygments.org/) is used for the syntax highlighting and can be installed with `sudo easy_install pygments`. Copy/Paste the function into…
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
function viewsource { | |
/usr/bin/curl --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0" -s "$1" | /usr/local/bin/pygmentize -g -O encoding='utf-8' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment