Sha256: 827eb19543b26b88ec2c3635d69bcc9e1db77b46665950ebf1211ce967ec7b10

Contents?: true

Size: 709 Bytes

Versions: 2

Compression:

Stored size: 709 Bytes

Contents

require 'rest_client'

module Orange
  class CloudResource < Orange::Resource
    ORANGE_PING_KEY = "c99550a0430eb9054eb4b7ee290664cf"
    call_me :cloud
    def afterLoad
      orange.register(:stack_loaded) do |stack|
        options[:ping_fm_key] = orange.options['ping_fm_key'] || false
      end
    end
    
    def microblog(packet, status, opts = {})
      params = {    :api_key => ORANGE_PING_KEY, 
                    :user_app_key => options[:ping_fm_key], 
                    :post_method => "microblog",
                    :body => status}.merge(opts)
      # Thread.new {
      xml_result = RestClient.post("http://api.ping.fm/v1/user.post", params) if params[:user_app_key]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
orange-0.1.8 lib/orange-more/cloud/resources/cloud_resource.rb
orange-0.1.7 lib/orange-more/cloud/resources/cloud_resource.rb