diff --git a/docs/acunote b/docs/acunote new file mode 100644 index 000000000..b5b567e3d --- /dev/null +++ b/docs/acunote @@ -0,0 +1,16 @@ +Acunote +======== + +Install Notes +------------- + + 1. You can find your acunote github token here: http://.acunote.com/repositories/github + +Developer Notes +--------------- + +data + - token + +payload + - refer to docs/github_payload diff --git a/services/acunote.rb b/services/acunote.rb new file mode 100644 index 000000000..7caa6fe93 --- /dev/null +++ b/services/acunote.rb @@ -0,0 +1,20 @@ +service :acunote do |data, payload| + token = data['token'] + path = "/source_control/github/#{token}" + + req = Net::HTTP::Post.new(path) + req.set_form_data('payload' => payload.to_json) + req["Content-Type"] = 'application/x-www-form-urlencoded' + + http = Net::HTTP.new("www.acunote", 443) + http.use_ssl = true + http.verify_mode = OpenSSL::SSL::VERIFY_NONE + begin + http.start do |connection| + connection.request(req) + end + rescue Net::HTTPBadResponse + raise GitHub::ServiceConfigurationError, "Invalid configuration" + end + nil +end