Create your own HTML menu of your favorite YouTube videos.
Today I’m going to show you how to create a simple “front end” for all your YouTube videos so that you’ll have a list of titles that you can just click onto in your browser for the video to play using the following simple HTML format…
<div><a href="Youtube Link"; Target="_blank"; >Youtube Title</a></div>
By inserting each Youtube link and the Youtube title as shown in the HTML command above, we can create a simple HTML page of clickable links. Of course if you are like me and have 100s of favorite Youtube songs we’re just going to have to automate things using a little coding which I’ll explain in due course.
Step1: Ok, to get started you’ll first need a text file list of your favorite video titles and links that looks like this…
Gloria Gaynor - Can't take my eyes off you
http://www.youtube.com/watch?v=uuvPvUmEzoE
10 CC - I'm Not In Love
http://www.youtube.com/watch?v=Y2BavhwpIJg
Promises - Baby It's You
http://www.youtube.com/watch?v=-pJVdIKHO8o
Evanescence - My Immortal
http://www.youtube.com/watch?v=5anLPw0Efmo
Boney M - Kalimba De Luna
http://www.youtube.com/watch?v=8JEjMW-Frqc
Jim Diamond - I Should Have Known Better
http://www.youtube.com/watch?v=Af3G2cfYayY
Firehouse - When I Look Into Your Eyes
http://www.youtube.com/watch?v=kxJBN_AHfas
Bad English - When I See You Smile
http://www.youtube.com/watch?v=oaGt3FJFZPA
Robbie Williams - Feel
http://www.youtube.com/watch?v=Vml2xJi5BWE
You can have hundreds of links in your list if you like as long there’s only one per line with the title first, and save it as a text file… MYLIST.TXT
Step2: Now here’s the “magic” part that does the conversion from MYLIST.TXT to MYLIST.HTML for you. It’s a small utility written here in Turbo Pascal which you can compile if you have Borland’s compiler, rewrite in your favorite programming language, or send me an email address so that I can send you the executable file as an attachment… (source code follows for those who want to compile it themselves or for the plain curious)
{$A+,B-,D-,E-,F-,G+,I-,K-,L-,N+,O-,P-,Q-,R-,S-,T-,V-,W-,X-,Y-}
{$M 8192,0,0}
PROGRAM YouTubeMaker; {Takes a list of song titles and links to create a HTML file}
VAR F1,F2:Text; S1,S2,S:String; N:Integer;
BEGIN
N:=0;
Assign(F2,'Mylist.html'); Rewrite(F2);
Assign(F1,'Mylist.txt'); Reset(F1);
WHILE NOT EOF(F1) DO
BEGIN
Readln(F1,S); Inc(N);
IF Odd(N) THEN S2:=S ELSE
BEGIN
S1:=S;
S:='<div><a href="'+S1+'"; Target="_blank"; >'+S2+'</a></div>';
Writeln(F2,S);
END;
END;
Close(F1); Close(F2);
END.
Step3: So in the new directory we created C:\MYLIST\ we should now have a text file called MYLIST.TXT and an executable file called MYLIST.EXE, and once we run our executable file it’ll create our MYLIST.HTML file which will load in our browser when we double-click on it with all our favorite Youtube links!
If you like what we’ve done so far drop me a line here and I’ll next show you how to beautify this HTML front end and even make it 2-3 columns wide!
Regards GR!