Skip Menu |

This queue is for tickets about the WWW-Facebook-API CPAN distribution.

Report information
The Basics
Id: 50199
Status: resolved
Priority: 0/
Queue: WWW-Facebook-API

People
Owner: unobe [...] cpan.org
Requestors: anthony [...] currentmarketing.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: WWW::Facebook::API video.upload doesn't work
Date: Sun, 4 Oct 2009 23:56:27 -0400
To: bug-www-facebook-api [...] rt.cpan.org
From: Anthony Bouvier <anthony [...] currentmarketing.com>
So, I may have a bug, or just my own serious misunderstanding of how the API works. In the main API.pm file, there is the sub _post_request() which is called from call() There is a hardcoded filename ('filename') and hardcoded Content-type ('image/jpeg'). For uploading images (even non-jpegs) this is fine because Facebook doesn't care about the Content-type or the filename actually. However, for video, it DOES care. With those lines in API.pm, you simple cannot currently upload video of any format. Facebook requires a filename WITH extension -- it checks for extension first for compatible types. So sending a hardcoded 'filename' doesn't cut it -- it will just return Error 352: Video file format is not supported. If you change the code (which I did) to accept a passed in filename (not the hardcoded, non-extension, 'filename') -- the video upload works. And images still work too. This is probably all happening because video.upload changed somehow since the release of the CPAN module. A few other notes: I had to set format => 'XML' for it to even start communicating -- Facebook was sending XML back and since JSON is the module's default, it was choking. Also worth noting in your documentation for newbies, in order to use video.upload you have to point to a different URL: http://api-video.facebook.com, and not api.facebook.com (the module's default). That's not a bug of course, just a helpful hint that could maybe go in the POD. I'm sure it is trivial, but if it would be helpful, I can share the code I had to hack into place in API.pm and also how I called it from my script. -- Anthony Bouvier Geek In Charge 1324 E. Washington Street Louisville, Kentucky 40206 Direct: 502.561.2422 Twitter: http://twitter.com/thebouv Facebook: http://facebook.com/thebouv
Subject: Re: [rt.cpan.org #50199] WWW::Facebook::API video.upload doesn't work
Date: Thu, 26 Nov 2009 10:22:19 -0800
To: Anthony Bouvier via RT <bug-WWW-Facebook-API [...] rt.cpan.org>
From: David Romano <unobe [...] cpan.org>
Hi Anthony, Anthony Bouvier via RT wrote on Sun, Oct 04, 2009 at 08:56:56PM PDT: Show quoted text
Sorry for taking really long to get back to you: life happened. Show quoted text
> If you change the code (which I did) to accept a passed in filename > (not the hardcoded, non-extension, 'filename') -- the video upload > works. And images still work too.
Awesome! That's good to know. I've changed that part to pass 'application/octet-stream' as the content type, and to optionally take a filename. Show quoted text
> This is probably all happening because video.upload changed somehow > since the release of the CPAN module.
Yeah, I don't remember reading that in the documentation. Since Facebook doesn't change their versioning when something changes in their API, it really is hard to track down when these kind of issues start. Show quoted text
> A few other notes: > > I had to set format => 'XML' for it to even start communicating -- > Facebook was sending XML back and since JSON is the module's default, > it was choking.
I have added a note to the documentation for video.upload stating the module's default will be used, so this problem should be resolved. Show quoted text
> Also worth noting in your documentation for newbies, in order to use > video.upload you have to point to a different URL: > http://api-video.facebook.com, and not api.facebook.com (the module's > default). That's not a bug of course, just a helpful hint that could > maybe go in the POD.
That was probably another oversight on my part. I've changed the method to use that server. Show quoted text
> I'm sure it is trivial, but if it would be helpful, I can share the > code I had to hack into place in API.pm and also how I called it from > my script.
I've added your name to the list of contributors to the module, and released a new version of the module on the CPAN. Let me know if you want to improve the module further. I have the source on github, so just mirror it and send me a pull request. Again, sorry for the delay in getting back to you. - David
Subject: Re: [rt.cpan.org #50199] WWW::Facebook::API video.upload doesn't work
Date: Sat, 28 Nov 2009 00:21:54 -0500
To: bug-WWW-Facebook-API [...] rt.cpan.org
From: Anthony Bouvier <anthony [...] currentmarketing.com>
Great to know I was a help! Your module is great. And thanks for the mention on contributors -- much appreciated! On Thu, Nov 26, 2009 at 1:22 PM, unobe@cpan.org via RT <bug-WWW-Facebook-API@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50199 > > > Hi Anthony, > Anthony Bouvier via RT wrote on Sun, Oct 04, 2009 at 08:56:56PM PDT: > Sorry for taking really long to get back to you: life happened. >
>> If you change the code (which I did) to accept a passed in filename >> (not the hardcoded, non-extension, 'filename') -- the video upload >> works.  And images still work too.
> Awesome! That's good to know. I've changed that part to pass > 'application/octet-stream' as the content type, and to optionally take a > filename. >
>> This is probably all happening because video.upload changed somehow >> since the release of the CPAN module.
> Yeah,  I don't remember reading that in the documentation. Since Facebook > doesn't change their versioning when something changes in their API, it really > is hard to track down when these kind of issues start. >
>> A few other notes: >> >> I had to set format => 'XML' for it to even start communicating -- >> Facebook was sending XML back and since JSON is the module's default, >> it was choking.
> I have added a note to the documentation for video.upload stating the module's > default will be used, so this problem should be resolved. >
>> Also worth noting in your documentation for newbies, in order to use >> video.upload you have to point to a different URL: >> http://api-video.facebook.com, and not api.facebook.com (the module's >> default).  That's not a bug of course, just a helpful hint that could >> maybe go in the POD.
> That was probably another oversight on my part. I've changed the method to use > that server. >
>> I'm sure it is trivial, but if it would be helpful, I can share the >> code I had to hack into place in API.pm and also how I called it from >> my script.
> I've added your name to the list of contributors to the module, and released a > new version of the module on the CPAN. Let me know if you want to improve the > module further. I have the source on github, so just mirror it and send me a > pull request. Again, sorry for the delay in getting back to you. > > - David > > >
-- Anthony Bouvier Geek In Charge 1324 E. Washington Street Louisville, Kentucky 40206 Direct: 502.561.2422 Twitter: http://twitter.com/thebouv Facebook: http://facebook.com/thebouv
fixed in 0.4.17