Skip to content

Instantly share code, notes, and snippets.

@necojackarc
Created November 6, 2015 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save necojackarc/2aed4d9cb44acc3e126b to your computer and use it in GitHub Desktop.
Save necojackarc/2aed4d9cb44acc3e126b to your computer and use it in GitHub Desktop.
Getting commit massage samples script powered by http://commit-m.minamijoyo.com/
#!/usr/bin/env ruby
require "net/http"
require "uri"
require "nokogiri"
params = { keyword: ARGV.join("\s") }
uri = URI.parse("http://commit-m.minamijoyo.com/commits/search")
uri.query = URI.encode_www_form(params)
response = Net::HTTP.get(uri)
html = Nokogiri::HTML.parse(response)
puts html.css("tbody > tr").map { |e| e.css("td").first.inner_text }
@necojackarc
Copy link
Author

Usage

You can use this script as below:

$ ./search_commit_msg Remove redundant
Remove redundant, duplicate comment
Remove redundant comments
Remove redundant 'window.'
remove redundant docs section
Remove redundant `<code>` styling
Remove redundant _config.yml quotes
Remove redundant parens
Remove redundant jshint comment
Remove redundant parentheses.
Remove redundant Sizzle.uniqueSort call
Remove redundant code.
remove redundant color rule
remove redundant color rule
remove redundant var
remove redundant variable
Remove redundant method
remove redundant variable
Remove redundant instance_variables (@colorize_logging)
Remove redundant #to_sym
Remove redundant code.
Remove redundant code.
Remove redundant tests method.
Remove redundant 'the'.
Remove redundant NullSerializer
Remove redundant test.
remove redundant condition
Remove redundant conditional.
Remove redundant windows checks
Remove redundant variable
Remove redundant uniq

It's so rough that there are lots of points to be improved.

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