Created
October 12, 2014 00:12
-
-
Save aj0strow/2bc25ff4c6a15404ad55 to your computer and use it in GitHub Desktop.
Redis Commands
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
if ARGV.length > 1 | |
puts 'redis-commands [group]' | |
exit 1 | |
end | |
group = ARGV.first | |
html = Nokogiri::HTML(open('http://redis.io/commands')) | |
selector = '.command a text()' | |
unless group.nil? | |
selector.prepend('li[data-group="%s"] ' % group) | |
end | |
commands = html.css(selector) | |
puts commands |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment