Classical ASP YouTube class

.........................................................

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.

Source code: Classical ASP YouTube class

~ End Article and Begin Conversation ~

~ Now It's Your Turn ~

Feel free to use <strong>, <em>, and <a href="">

[]

The Blogroll

Search this Site


[]