Created
November 6, 2015 10:32
-
-
Save necojackarc/2aed4d9cb44acc3e126b to your computer and use it in GitHub Desktop.
Getting commit massage samples script powered by http://commit-m.minamijoyo.com/
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
#!/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 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
You can use this script as below:
It's so rough that there are lots of points to be improved.