-
-
Save prabgupt/9885986309e63e38a598 to your computer and use it in GitHub Desktop.
method to call python script that will return token and url to upload video on youtube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def uploadToken | |
cmd = Rails.root.to_s + '/public/scripts/youtubeUtilAPIs.py' | |
title = "Test Video" | |
description = "Test Video description" | |
resp = `#{cmd} -t "#{title},#{description}"` | |
resp = resp.split('::') | |
response = (resp.length == 2) ? {:uploadUrl => resp[0], :token => resp[1]} : "" | |
respond_to do |format| | |
format.js {render :js => response.to_json} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment