Sha256: 4284401fb2a9ccbbfdaf90e819debb093e5d4457ee8ad90691b8e69ee6b0f783

Contents?: true

Size: 518 Bytes

Versions: 1

Compression:

Stored size: 518 Bytes

Contents

module Imuze
  class GetMusic < Struct.new(:token, :mp3_uri)
    include Methadone::CLILogging
    include Methadone::SH
    require 'uri'
    require 'net/http'
    require 'json'

    def self.call(*args)
      new(*args).call
    end

    def call
      sh command do |stdout, stderr|
        puts 'We hope you liked it !'
      end
    end

    private

    def command
      %Q(curl "http:#{mp3_uri}"  -s -H "Content-Type: application/json"  -H "Authorization: #{token}" | mpg123 - 2> /dev/null)    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
imuzer-0.0.1 lib/imuze/get_music.rb