Skip to content

Instantly share code, notes, and snippets.

@natanrolnik
Last active October 21, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natanrolnik/c8062857a9d71914e8c8 to your computer and use it in GitHub Desktop.
Save natanrolnik/c8062857a9d71914e8c8 to your computer and use it in GitHub Desktop.
def push_notify(lane_name, success)
require 'uri'
uri = URI.parse("https://api.parse.com/")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new("/1/classes/LaneResult")
request.add_field('Content-Type', 'application/json')
request.add_field('X-Parse-Application-Id', 'my_parse_id')
request.add_field('X-Parse-Master-Key', 'my_parse_key')
request.body = {"EventType"=> "Deploy #{lane_name} - #{success}",
"App"=> "MyIndieApp"}.to_json
response = http.request(request)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment