Anything related to the Internet, computers and technology in general.
by MGCN » Tue Oct 23, 2012 2:08 pm
you have too much time on your hands GR
-
MGCN
- Member
-
- Posts: 75
- Joined: Sat Jul 14, 2012 3:33 am
by Get Real! » Tue Oct 23, 2012 8:04 pm
A translucent hypnotic bollocks interface… when you scroll the buttons go over the image which you can see being left behind right through them. Wow eye-candy for jelly heads!
05311.jpg
Now back to conservative style/colours and the latest source code…
{$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 & links to create a HTML menu}
USES Dos;
{---------------------------------------------------------}
FUNCTION FileExist(CONST S:String):Boolean;
BEGIN
FileExist:=FSearch(S,GetEnv('PATH'))<>'';
END;
{---------------------------------------------------------}
PROCEDURE DeleteFile(CONST S:String);
VAR F:File;
BEGIN Assign(F,S); SetFAttr(F,$20); Erase(F); END;
{---------------------------------------------------------}
FUNCTION TrimRight(S:String; Ch:Char):String;
BEGIN
WHILE S[Length(S)]=Ch DO Dec(S[0]);
TrimRight:=S;
END;
{---------------------------------------------------------}
FUNCTION TrimLeft(CONST S:String; Ch:Char):String;
VAR N:Integer;
BEGIN
N:=1;
WHILE S[N]=Ch DO Inc(N);
TrimLeft:=Copy(S,N,Succ(Length(S)-N));
END;
{---------------------------------------------------------}
FUNCTION TrimBoth(CONST S:String; Ch:Char):String;
BEGIN
TrimBoth:=TrimLeft(TrimRight(S,Ch),Ch);
END;
{---------------------------------------------------------}
PROCEDURE ReplaceStr(VAR S1:String; S2:String; CONST S3:String);
VAR P:Byte; Ch:Char;
BEGIN
IF S2<>S3 THEN
BEGIN
IF Pos(S2,S3)>0 THEN
BEGIN
Ch:=#0;
WHILE (Pos(Ch,S1)>0) OR (Pos(Ch,S2)>0) DO Inc(Ch);
ReplaceStr(S1,S2,Ch); S2:=Ch;
END;
P:=0;
WHILE Pos(S2,S1)>0 DO
BEGIN
P:=Pos(S2,S1);
Delete(S1,P,Length(S2));
Insert(S3,S1,P);
END;
END;
END;
{---------------------------------------------------------}
VAR F1,F2,F3,F4:Text; S,Z:String; N,X:Integer; Last:Byte;
BEGIN
N:=0; X:=0; Last:=0; S:='Mylist.txt';
Assign(F3,'Titles.txt'); Rewrite(F3);
Assign(F4,'Links.txt'); Rewrite(F4);
IF FileExist(S)=False THEN
BEGIN Assign(F1,S); Rewrite(F1); Close(F1); END;
Assign(F1,S); Reset(F1);
WHILE NOT EOF(F1) DO
BEGIN
Readln(F1,S);
ReplaceStr(S,#9,' ');
S:=TrimBoth(S,#32);
IF S<>'' THEN
BEGIN
Inc(N);
{------------------Parsing------------------}
IF Pos('http://',S)=1 THEN {Internet address}
BEGIN
IF Last<>1 THEN Writeln(F3,''''+'Untitled'+''',');
Writeln(F4,''''+S+''','); Last:=2;
END ELSE
BEGIN
ReplaceStr(S,'??','?');
ReplaceStr(S,'\','');
ReplaceStr(S,'=','');
ReplaceStr(S,'''','\''');
ReplaceStr(S,'"','');
IF Pos('---',S)=1 THEN {Category}
BEGIN
IF Last=1 THEN Writeln(F4,''''+'http://www.youtube.com/'+''',');
Z:=Copy(S,4,Length(S)-3);
ReplaceStr(Z,'-','');
IF Z='' THEN Z:='Untitled Category';
Writeln(F3,''''+Z+''',');
Writeln(F4,''''+'-'+''',');
Last:=3;
END ELSE {Song title}
BEGIN
IF Last=1 THEN Writeln(F4,''''+'http://www.youtube.com/'+''',');
Writeln(F3,''''+S+''',');
Inc(X); Last:=1;
END;
END;
{------------------------------------------}
END;
END;
Close(F1); Close(F3); Close(F4);
N:=N SHR 1;
Assign(F2,'Mylist.html'); Rewrite(F2);
{Hardcoding some HTML/CSS/Javascript basics}
Writeln(F2,'<!DOCTYPE html>');
Writeln(F2,'<html>');
Writeln(F2,'<title>YourTube - Your video front end!</title>');
Writeln(F2,'<body bgcolor="#0B2F3A"></body>');
Writeln(F2,'');
Writeln(F2,'<style type="text/css">');
Writeln(F2,'.Message {');
Writeln(F2,'Font-family: Comic Sans MS;');
Writeln(F2,'Font-size: 12px;');
Writeln(F2,'Font-weight: Normal;');
Writeln(F2,'Font-style: Normal;');
Writeln(F2,'Text-decoration: None;');
Writeln(F2,'Text-align: Center;');
Writeln(F2,'Color: #FFFFFF;');
Writeln(F2,'Text-shadow: 1px 1px 2px #000;');
Writeln(F2,'Filter:Shadow(Color=#000000 ,Strength=1);');
Writeln(F2,'Height:0;}');
Writeln(F2,'');
Writeln(F2,'.Category {');
Writeln(F2,'Font-family: Comic Sans MS;');
Writeln(F2,'Font-size: 14px;');
Writeln(F2,'Font-weight: Normal;');
Writeln(F2,'Font-style: Normal;');
Writeln(F2,'Text-decoration: None;');
Writeln(F2,'Text-align: Left;');
Writeln(F2,'Color: #FE2E2E;');
Writeln(F2,'Text-shadow: 1px 1px 2px #000;');
Writeln(F2,'Filter:Shadow(Color=#000000 ,Strength=2);');
Writeln(F2,'Height:0;}');
Writeln(F2,'');
Writeln(F2,'.WinButton {');
Writeln(F2,'-moz-box-shadow: 3px 3px 4px #000;');
Writeln(F2,'-webkit-box-shadow: 3px 3px 4px #000;');
Writeln(F2,'box-shadow: 3px 3px 4px #000;');
Writeln(F2,'/* For IE 8 */');
Writeln(F2,'-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=90, Color=#000)";');
Writeln(F2,'/* For IE 5.5 - 7 */');
Writeln(F2,'filter: progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=90, Color=#000);');
{
opacity: .70;
filter: alpha(opacity=70);
}
Writeln(F2,'Cursor: Pointer;');
Writeln(F2,'Padding: 0px;');
Writeln(F2,'Font-family: Comic Sans MS;');
Writeln(F2,'Font-size: 13px;');
Writeln(F2,'Font-weight: Normal;');
Writeln(F2,'Font-style: Normal;');
Writeln(F2,'Text-decoration: None;');
Writeln(F2,'Text-align: Center;');
Writeln(F2,'Color: #FFFFFF;');
Writeln(F2,'Background-color: #686868;');
{
Writeln(F2,'Border-style: Solid;');
}
Writeln(F2,'Border-color: #A0A0A0;');
Writeln(F2,'Border-width: 1px;');
Writeln(F2,'Text-shadow: 1px 1px 2px #000;');
Writeln(F2,'Filter:Shadow(Color=#000000 ,Strength=1);');
Writeln(F2,'Height:0;}');
Writeln(F2,'</style>');
Writeln(F2,'');
Writeln(F2,'<img src="YourTube.png"; style="position:absolute; top:15px; left:10px;">');
Write(F2,'<a href="javascript:window.scrollTo(0,7000);"; style="position:absolute; Top:10px; left:930px;" ');
Writeln(F2,'Title="Go to the end"; Class="Message";>[Bottom]</a>');
Write(F2,'<a style="position:absolute; Top:40px; left:925px;" ');
Writeln(F2,'Title="Total number of videos"; Class="Message";>Total: ',X,'</a>');
Writeln(F2,'');
Writeln(F2,'<script type="text/javascript">');
Writeln(F2,'function RunURL(URL,Name) {');
Writeln(F2,'window.open (URL,Name,');
Writeln(F2,'"Width=1010,\');
Writeln(F2,'Height=800,\');
Writeln(F2,'Top=0,\');
Writeln(F2,'Left=0,\');
Writeln(F2,'Channelmode=0,\');
Writeln(F2,'Titlebar=0,\');
Writeln(F2,'Menubar=0,\');
Writeln(F2,'Toolbar=0,\');
Writeln(F2,'Directories=0,\');
Writeln(F2,'Location=0,\');
Writeln(F2,'Status=0,\');
Writeln(F2,'Scrollbars=1,\');
Writeln(F2,'Resizable=1,\');
Writeln(F2,'Fullscreen=0");');
Writeln(F2,'}');
Writeln(F2,'document.write(''<form>'');');
Writeln(F2,'');
Writeln(F2,'var Titles = new Array(');
Assign(F3,'Titles.txt'); Reset(F3);
WHILE NOT EOF(F3) DO
BEGIN
Readln(F3,S);
Writeln(F2,S);
END;
Close(F3);
DeleteFile('Titles.txt');
Writeln(F2,''''');');
Writeln(F2,'');
Writeln(F2,'var Links = new Array(');
Assign(F4,'Links.txt'); Reset(F4);
WHILE NOT EOF(F4) DO
BEGIN
Readln(F4,S);
Writeln(F2,S);
END;
Close(F4);
DeleteFile('Links.txt');
Writeln(F2,''''');');
Writeln(F2,'');
Writeln(F2,'var X=0; var Y=80; var Temp="";');
Writeln(F2,'for (i=0; i<',N,'; i++){');
{---Check and create category--}
Writeln(F2,'if (Links[i]==''-'') {');
Writeln(F2,'if (X==0) {Y=Y+32;} else {Y=Y+64}');
Write(F2,'document.write(''<a Class="Category"; Title="Left-click on buttons to PLAY and Right-click to SEARCH"; ');
Writeln(F2,'Style="Position:Absolute; Width:600px; Height:15px; Left:''+10+''px; Top:''+Y+''px;";>''+Titles[i]+''</a>'');');
Writeln(F2,'X=0; Y=Y+32;');
Writeln(F2,'} else {');
{---Or continue with buttons---}
Writeln(F2,'Temp=Titles[i]; Temp=Temp.replace("’",""); Temp=Temp.replace("''",""); Temp=Temp.replace("''","");');
Writeln(F2,'Temp=Temp.replace(''"'',""); Temp=Temp.replace("&","and"); Temp=Temp.replace("“","");');
Write(F2,'document.write(''<input Type="button" Class="WinButton" Title="''+Titles[i]+''"; ');
Write(F2,'Style="Position:Absolute; Width:320px; Height:24px; Left:''+(X*330+10)+''px; Top:''+Y+''px;"; ');
Write(F2,'Value="''+Titles[i]+''"; oncontextmenu="RunURL(\''http://www.youtube.com/results?search_query=''');
Writeln(F2,'+Temp+''\'');return false;"; OnClick="RunURL(\''''+Links[i]+''\'')";/>'');');
Writeln(F2,'X++; if (X>2) {X=0; Y=Y+32;}}}'); {<- put an extra curley here}
Write(F2,'document.write(''<input Type="button" Class="WinButton"; value="View List"; Title="View your video list"; ');
Write(F2,'Style="Position:Absolute; Width:65px; Height:20px; Left:800px; ');
Writeln(F2,'Top:30px;"; OnClick="RunURL(\''Mylist.txt\'')";>'');');
Writeln(F2,'document.write(''</form>'');');
Write(F2,'document.write(''<a href="javascript:window.scrollTo(0,0);"; Style="Position:Absolute; ');
Writeln(F2,'Left:930px; Top:''+(Y+20)+''px;" Title="Go to the top"; Class="Message";>[Top]</a><br><br>'');');
Writeln(F2,'</script>');
Writeln(F2,'</html>');
Close(F2);
END.
-
Get Real!
- Forum Addict
-
- Posts: 48333
- Joined: Mon Feb 26, 2007 12:25 am
- Location: Nicosia
by Get Real! » Tue Oct 30, 2012 4:01 am
In the space of two weeks my humble little utility has evolved into a full blown Web total-entertainment package!
YourTube01.jpg
YourTube02.jpg
YourTube03.jpg
-
Get Real!
- Forum Addict
-
- Posts: 48333
- Joined: Mon Feb 26, 2007 12:25 am
- Location: Nicosia
by Get Real! » Sat Dec 08, 2012 1:46 am
This app has gone into commercial production and has to be released early in the new year so I’ll need some beta testers soon, so who better than our in-house pro web developers Me-Ed and Sotos!
So what do you say fellas?
-
Get Real!
- Forum Addict
-
- Posts: 48333
- Joined: Mon Feb 26, 2007 12:25 am
- Location: Nicosia
Return to Internet, Computers and Technology
Who is online
Users browsing this forum: No registered users and 0 guests