Skip to content

Instantly share code, notes, and snippets.

@walesmd
Created October 26, 2013 18:12
Show Gist options
  • Save walesmd/7172724 to your computer and use it in GitHub Desktop.
Save walesmd/7172724 to your computer and use it in GitHub Desktop.
# CanIUse.com Command Line Search Utility
# Michael Wales, http://github.com/walesmd
#
# A very basic bash function that quickly searches http://caniuse.com/
#
# Examples:
# caniuse
# caniuse border-radius
# caniuse "alpha transparency" counters "canvas drawings" html svg
function caniuse()
{
local domain="http://caniuse.com/"
local query
if [ $# -eq 0 ]; then
open ${domain}
else
for term in "$@"; do
query=$(python -c "import sys, urllib as ul; print ul.quote('${term}');")
open "${domain}#search=${query}"
done
fi
}
@thatkookooguy
Copy link

I get an error when I try to use this.
Couldn't get a file descriptor referring to the console

Do I need to install the "open" command?

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