Sha256: 3cb7fe883fd1684cffa1167bf8ae7cd776fddab7dcb0bcf7a293b37fc3c00270

Contents?: true

Size: 756 Bytes

Versions: 16

Compression:

Stored size: 756 Bytes

Contents

require 'rest_client'

module Orange
  class CloudResource < Orange::Resource
    ORANGE_PING_KEY = "c99550a0430eb9054eb4b7ee290664cf"
    call_me :cloud
    def stack_init
      options[:ping_fm_key] = orange.options['ping_fm_key'] || false
      options[:ping_fm_app_key] = orange.options['ping_fm_app_key'] || false
    end
    
    def microblog(packet, status, opts = {})
      params = {    :api_key => options[:ping_fm_app_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

16 entries across 16 versions & 2 rubygems

Version Path
orange-more-0.7.3 lib/orange-more/cloud/resources/cloud_resource.rb
orange-more-0.7.2 lib/orange-more/cloud/resources/cloud_resource.rb
orange-more-0.7.1 lib/orange-more/cloud/resources/cloud_resource.rb
orange-more-0.6.5 lib/orange-more/cloud/resources/cloud_resource.rb
orange-more-0.6.4 lib/orange-more/cloud/resources/cloud_resource.rb
orange-more-0.6.3 lib/orange-more/cloud/resources/cloud_resource.rb
orange-more-0.6.2 lib/orange-more/cloud/resources/cloud_resource.rb
orange-more-0.6.0 lib/orange-more/cloud/resources/cloud_resource.rb
orange-more-0.5.8 lib/orange-more/cloud/resources/cloud_resource.rb
orange-more-0.5.7 lib/orange-more/cloud/resources/cloud_resource.rb
orange-0.5.5 lib/orange-more/cloud/resources/cloud_resource.rb
orange-0.5.4 lib/orange-more/cloud/resources/cloud_resource.rb
orange-0.5.3 lib/orange-more/cloud/resources/cloud_resource.rb
orange-0.5.2 lib/orange-more/cloud/resources/cloud_resource.rb
orange-0.5.1 lib/orange-more/cloud/resources/cloud_resource.rb
orange-0.4.0 lib/orange-more/cloud/resources/cloud_resource.rb