better video api implemented
This commit is contained in:
parent
6e06426db7
commit
1c6c7e02c4
@ -9,7 +9,7 @@ class BetterVideo
|
||||
|
||||
def addVideo(campaign)
|
||||
uri = URI.parse(@addvideo_url)
|
||||
header = {}#'Content-Type' => 'text/json'}
|
||||
header = {}
|
||||
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
request = Net::HTTP::Post.new(uri.request_uri, header)
|
||||
@ -19,14 +19,15 @@ class BetterVideo
|
||||
resp = JSON.parse(response.body)
|
||||
puts resp
|
||||
|
||||
if resp["success"]
|
||||
if resp["errorcode"] == 0
|
||||
resp[:success] = true
|
||||
resp[:message] = "Successfully submitted to BetterVideo, Please wait."
|
||||
else
|
||||
resp[:message] = resp["errormessage"]
|
||||
resp[:message] = "Error Code #{resp["errorcode"]}: #{resp["errormessage"]}"
|
||||
if resp["errorcode"] == 1
|
||||
resp[:message] += "Please Contact Dev"
|
||||
end
|
||||
end
|
||||
# "{\"errorcode\":1,\"errormessage\":\"There was an error parsing the supplied JSON.\",\"listingcode\":null,\"success\":false,\"videocode\":null}"
|
||||
|
||||
resp
|
||||
end
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
<div class="error_explanation">
|
||||
<ul>
|
||||
<% @campaign.errors.full_messages.each do |msg| %>
|
||||
<li class="alert alert-danger"><%= msg %></li>
|
||||
<li class="alert alert-danger"><%= msg.html_safe %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -20,8 +20,5 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h3>Cancel my account</h3>
|
||||
|
||||
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
|
||||
|
||||
<%= link_to "Back", :back %>
|
||||
|
Loading…
Reference in New Issue
Block a user