Add a dfff function for URLs #211

wants to merge 2 commits into


None yet

3 participants


Comes in handy for me

@mathiasbynens mathiasbynens commented on the diff Jun 5, 2013
@@ -251,3 +251,21 @@ function gi() {
local IFS=,
eval npm install --save-dev grunt-{"$*"}
+# Compare two urls
+# Usage: `urldiff`
+function urldiff () {
+ local file
+ local files=""
+ for url in "$@"
+ do
+ file="urldiff-"${url//[^a-zA-Z0-9]/}
+ files=$files" "$file
+ echo "downloading $url > $file"
+ lwp-request -m 'GET' $url > $file
mathiasbynens Jun 5, 2013

Honest question: why lwp-request instead of just curl?

robcolburn Jun 5, 2013

Honestly, I'm a bit of a shell-scripting novice, and I just copied the GET alias from this repo. :)

Is there a strong reason to go with curl instead? While lwp has perl-dependance and weaker performance, I like that it has prompting for http-auth credentials.


You can diff URLs by using vimdiff or vim -d.

Simply vim -d

Source: (the bonus on the bottom of the article).


Woo, I didn’t know about vim -d. Awesome!

Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment