Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (18 sloc) 694 Bytes
# NOTE: many folks are now using Faraday instead:
# https://github.com/technoweenie/faraday
require 'httparty'
class Server
include HTTParty
base_uri "http://host.com:8080"
def self.create_token(user, asset, original)
response = self.post("/assets", :query => {:user => user, :asset => asset, :original => original})
end
def self.get_token(user, asset, token)
response = self.get("/assets/show/#{token}.json")
end
# for testing only - this will normally be handled by the swf viewer
def self.get_original_url(user, asset, token)
response = get_token(user, asset, token)
url = "#{DIGITAL_HOST}:#{DIGITAL_PORT}/assets/show/#{token}.swf"
end
end