Sha256: 14708baf6a7d5bf30a70c987a27947dd122fea891e351069d2835981025c5ca3

Contents?: true

Size: 577 Bytes

Versions: 7

Compression:

Stored size: 577 Bytes

Contents

module Caboodle
  class Soundcloud < Caboodle::Kit
    
    menu "Mixes", "/mixes" do
      @title = "Mixes"
      @mixes = SoundcloudAPI.sets
      haml :soundcloud
    end

    required [:soundcloud_query]
  end

  class SoundcloudAPI < Weary::Base
    
      declare "sets" do |r|
        r.url = "http://api.soundcloud.com/playlists?q=#{Site.soundcloud_query}"
        r.via = :get
        r.headers = {'Accept' => 'application/xml'}
      end
      
      def self.sets
        Hashie::Mash.new(SoundcloudAPI.new.sets.perform_sleepily.parse).playlists
      end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
caboodle-0.2.1 lib/caboodle/kits/soundcloud/soundcloud.rb
caboodle-0.2.0 lib/caboodle/kits/soundcloud/soundcloud.rb
caboodle-0.1.9 lib/caboodle/kits/soundcloud/soundcloud.rb
caboodle-0.1.8 lib/caboodle/kits/soundcloud/soundcloud.rb
caboodle-0.1.7 lib/caboodle/kits/soundcloud/soundcloud.rb
caboodle-0.1.6 lib/caboodle/kits/soundcloud/soundcloud.rb
caboodle-0.1.5 lib/caboodle/kits/soundcloud/soundcloud.rb