Zach Cowan
Activity
-
2 days agoZach Cowan commented on Upload API ProblemsI edited the post as it looks like the code got garbled during posting, this should be right now. I am trying to implement upload via the API in Ruby using the net/http lib. I dont seem to be getting anywhere so I am hoping somebody can offer some assistance to help me figure out where the hurdle is. Here is the code I have, at the point that this runs I already have logged-in to the website as the user (which has granted athorization to the application), have an auth_token and a ticket_id for the upload. host = 'www.vimeo.com' upload_path = '/services/upload' upload_base_sig = "#{@secret}api_key#{@api_key}ticket_id#{ticket}" upload_api_sig = Digest::MD5.hexdigest( upload_base_sig ) # Create the POST data, multipart/form format data = <<"DATA" --vimeo_upload Content-Disposition: form-data; name="api_key" #{@api_key} --vimeo_upload Content-Disposition: form-data; name="auth_token" #{token} --vimeo_upload Content-Disposition: form-data; name="api_sig" #{upload_api_sig} --vimeo_upload Content-Disposition: form-data; name="ticket_id" #{ticket} --vimeo_upload Content-Disposition: form-data; name="video"; filename="zach.mpg" Content-Transfer-Encoding: binary Content-Type: video/mpg #{video} --vimeo_upload-- DATA headers = { 'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/msword, application/x-gsarcade-launch, */*', 'Accept-Language' => 'en-us', 'Host' => 'www.vimeo.com', 'Referer' => "http://www.vimeo.com/", 'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)', 'Content-Type' => 'multipart/form-data; boundary="vimeo_upload"', 'Accept-Encoding' => 'gzip, deflate', 'Content-Length' => data.length.to_s, 'Connection' => 'Keep-Alive', 'Cache-Control' => 'no-cache', 'Cookie' => cookies } http = Net::HTTP.new( host ) resp, data = http.post( upload_path , data, headers ) puts 'Code: ' resp.code puts 'Message: ' resp.message puts 'Data: ' puts data # It returns code 200 and the message is Ok, but the data passed back doesn't look right, it looks like the binary video content, or at least a chunk of it. I think the problem is in the post data code, but not certain... Am hoping someone spots a problem for me to address. Thanks, Andy
-
6 days agoZach Cowan commented on Vimeo Application Authorization Procedure - Feature RequestHi, I am working through the Application authorization process now for an app I am building. The problem I am seeing involves the Vimeo application authorization_page which allows the user to grant permissions to the app, etc ... if the user is not logged-in on their web browser at the time the process ends here, the authorization url redirects to the login form, but even after a successful login it does not return the user to the authorization approval page, they would have to then repeat the procedure from the application (which is very clunky). Is it possible to have a successful login automatically take the user to the auth page again for them to grant approval? I have tried bypassing all of this by using WWW::Mechanize which can slurp a page, access a specific form and submit it programmatically but it does not work in the authorization portion of this process, not sure why it fails as the mechanize lib keeps track of all cookies and simulates the user being logged-in to the Vimeo website. This would be the ideal solution if I could get that working, but the above request is livable also. :) I am building this in Ruby by the way and building a Ruby Vimeo lib in the process as I go. Please advise. Thanks! Andy
Video Request
Open Requests
- Vimeo: About / Blog / Developers / Forums / Help! / Site Map
- Legal: © 2008 Connected Ventures, LLC. All rights reserved. / Terms & Conditions / Privacy Statement



Top
Bottom