Believe it or not but from time to time I actually get to do some programing with classical ASP, you know that stoneage technology that came before the .NET framework. Back in the days the concept of using classes was beyond me so when I got the chance the other day to do some ASP coding I decided to do it the OOP way.
Classical ASP actually offers a pretty decent support for classes. It has private and public properties, constructors, functions, sub’s and getter and setter methods similar to those in ASP.NET.
The job was to create a video listing page for a clients site where the client would upload videos on YouTube and then have them automatically listed on her own site. The class supports video listing by searching, videos uploaded by a users and videos from a specific feed.
Let’s have a look at an example:
Set results = Server.CreateObject("Scripting.Dictionary")
Set yt = new YouTube
yt.Search results, "", "BillGates", 1, 10, "video", true, 0, "rating"
keys = results.Keys
For i = 0 To results.Count -1
Response.Write(results.Item(keys(i)).Title & "<br/>")
Response.Write(results.Item(keys(i)).ShortDescription & "<br/>")
Next
The code above would return videos 1-10 uploaded by the user BillGates sorted by rating. Download the source code below.
April 14th, 2008
by Mark
After a little bit of tweaking I got this API to work. I had a question as to how you would go about display the videos once an item was clicked on. There is a call to a sub PrintEmbededHTML, but I am not sure how to get it to display on a seperate page. Thanks for a great script!