Skip to content

Commit

Permalink
Added acunote github service
Browse files Browse the repository at this point in the history
  • Loading branch information
smetana committed Feb 3, 2011
1 parent e38108a commit 6d58d4b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/acunote
@@ -0,0 +1,16 @@
Acunote
========

Install Notes
-------------

1. You can find your acunote github token here: http://<yourdomain>.acunote.com/repositories/github

Developer Notes
---------------

data
- token

payload
- refer to docs/github_payload
20 changes: 20 additions & 0 deletions 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

0 comments on commit 6d58d4b

Please sign in to comment.