First draft of new YouTube API

So not long after I had released my YouTubeCFC wrapper, Google dared to update the API to match the rest of their services. I didn’t bother updating my code as I wanted to wait till upload support was done. YouTube now officially allows you to upload (and even update) videos.

I’ve begun work on rewriting my CFC. It supports basic reading (get top videos for example), but no searching yet. But I did get upload working. Here is an example of how easy it is:

<cfset yt = createObject("component", "youtube")> <cfset yt.setDeveloperKey("xxx")>

<cfset yt.login(“cfjedimaster”, “likeidsay”)> <cfset r = yt.upload(expandPath(‘./movie2.mov’),’Test Upload’,’Playing with youtube’,’Music’,’testing,fun’)> <cfoutput>id=#r#</cfoutput> </code>

I’ve included the CFC for folks to play with, and once I get a bit more of the API done I’ll replace the CFC at RIAForge.

You will need a valid login and a developer key. Also there seems to be a quota limit. I ran into after uploading about 10 videos.<p>Download attached file.</p>

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments