Skip to content

Instantly share code, notes, and snippets.

@prabgupt
Created May 12, 2011 08:25
Show Gist options
  • Save prabgupt/9885986309e63e38a598 to your computer and use it in GitHub Desktop.
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
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