<?php /** * Save favorite youtube links in one place * * @author Ioannis Kolovos * @version $Id$ * @copyright netWorks Inc!, 25 November, 2011 * @package default *javascript link: javascript: var l = window.location; var t = escape(document.title); window.location ="HOST/?l="+ l + "&t="+t+"&h=02ce4c679b9a06815a8644a5d911e46b"; **/ $date = date('l jS \of F Y h:i:s A'); $url= $_GET[l]; $tmp= str_replace("::", " " , $_GET[t]); $title = str_replace("- YouTube", "", $tmp); $hash= $_GET[h]; $vdb = "videos.txt"; $line = file_get_contents($vdb); $host = "/"; $validation = "02ce4c679b9a06815a8644a5d911e46b"; $cache ="./cache/"; $cache_imgs = scandir($cache); function getImage($id) { global $cache_imgs, $cache; if (in_array($id .".jpg", $cache_imgs)){ return $cache.$id .".jpg"; } else { $thumb = "http://img.youtube.com/vi/". $id. "/0.jpg"; $get_image = file_get_contents($thumb); $local_image = $cache.$id.".jpg"; file_put_contents($local_image, $get_image, FILE_APPEND | LOCK_EX); return $local_image; } } if (isset($hash) && $hash == $validation) { parse_str( parse_url( $url, PHP_URL_QUERY ), $getdata ); $data = $getdata['v']; if ( preg_match( "/^" . $data . "/", $line ) ) { print "<b>Video posted allready</b><br/>"; exit(); } else { $stringData = $title . "::" . $data . "::" . $date . "#"; file_put_contents($vdb, $stringData, FILE_APPEND | LOCK_EX); echo"<meta http-equiv=\"refresh\" content=\"0; url= $host\">"; echo "<div style=\"text-aling:center\"><h1>Video saved :)</h1></div>"; } } else { ?> <!doctype html public "�"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" > <title dir="ltr">:: Emergency Favorite Songs ::</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" media="screen" href="style.css?v=2" > <script src="http://code.jquery.com/jquery-latest.js"></script> <!--http://johnkolovos.blogspot.com/2011/11/how-to-save-youtube-links-in-your-page.html --> </head> <body> <?php $info = explode("#", $line); array_reverse($info); $size = count($info)-1; $i = 0; echo $i; foreach ($info as $value) { if ($i<$size) { $video = split("::", $value); ?> <div class="box"> <!-- <h1><?php echo $video[0]; ?></h1>--> <?php ?> <a href="#"><img id="<?php echo $video[1]; ?>" style="height: 200; width: 200px" src="<?php echo getImage( $video[1]); ?>" /></a> <p id="<?php echo $video[1]; ?>_p" title="@<?php echo $video[2]; ?>"><?php echo $video[0]; ?></p> <div id="<?php echo $video[1]; ?>_" style="display:none"> <object style="height: 200; width: 200px" > <param name="movie" value="http://www.youtube.com/v/<?php echo $video[1]; ?>?version=3&feature=player_detailpage&autoplay=1"> <param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"> <embed src="http://www.youtube.com/v/<?php echo $video[1]; ?>?version=3&feature=player_detailpage&autoplay=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="200" height="200"></object> </div> </div> <?php } $i++; }} ?> <script> $('img').click(function () { var id =$(this).attr('id'); $(this).fadeOut("fast"); $('#'+id+'_p').css("display", "none"); $('#'+id+'_').css("display", "inline"); return false; }); </script>
style.css
.video { text-shadow: 1px 1px 3px #888; /* FF3.5+, Opera 9+, Saf1+, Chrome, IE10 */ -webkit-box-shadow: 0px 0px 4px #ffffff; /* Saf3-4, iOS 4.0.2 - 4.2, Android 2.3+ */ -moz-box-shadow: 0px 0px 4px #ffffff; /* FF3.5 - 3.6 */ box-shadow: 0px 0px 4px #ffffff; /* Opera 10.5, IE9, FF4+, Chrome 6+, iOS 5 */ text-align:center; padding-top:10px; background-color: #444444; background-image: -webkit-gradient(linear, left top, left bottom, from(#444444), to(#999999)); /* Saf4+, Chrome */ background-image: -webkit-linear-gradient(top, #444444, #999999); /* Chrome 10+, Saf5.1+, iOS 5+ */ background-image: -moz-linear-gradient(top, #444444, #999999); /* FF3.6 */ background-image: -ms-linear-gradient(top, #444444, #999999); /* IE10 */ background-image: -o-linear-gradient(top, #444444, #999999); /* Opera 11.10+ */ background-image: linear-gradient(top, #444444, #999999); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#444444', EndColorStr='#999999'); /* IE6-IE9 */ -webkit-border-radius: 12px; /* Saf3-4, iOS 1-3.2, Android <e;1.6 */ -moz-border-radius: 12px; /* FF1-3.6 */ border-radius: 12px; /* Opera 10.5, IE9, Saf5, Chrome, FF4, iOS 4, Android 2.1+ */ -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box; padding-bottom:20px; font-family:Georgia } p{ margin-top:-35px; padding-bottom:10px; font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif; } h1 { padding-top:-35px; font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif; } body{ background:#D1D1D1; color:#323232; text-align:center; text-shadow:0 1px 0 #FFFFFF; font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif; font-size: 13px; } .video { text-shadow: 1px 1px 3px #888; /* FF3.5+, Opera 9+, Saf1+, Chrome, IE10 */ -webkit-box-shadow: 0px 0px 4px #ffffff; /* Saf3-4, iOS 4.0.2 - 4.2, Android 2.3+ */ -moz-box-shadow: 0px 0px 4px #ffffff; /* FF3.5 - 3.6 */ box-shadow: 0px 0px 4px #ffffff; /* Opera 10.5, IE9, FF4+, Chrome 6+, iOS 5 */ text-align:center; padding-top:10px; background-color: #444444; background-image: -webkit-gradient(linear, left top, left bottom, from(#444444), to(#999999)); /* Saf4+, Chrome */ background-image: -webkit-linear-gradient(top, #444444, #999999); /* Chrome 10+, Saf5.1+, iOS 5+ */ background-image: -moz-linear-gradient(top, #444444, #999999); /* FF3.6 */ background-image: -ms-linear-gradient(top, #444444, #999999); /* IE10 */ background-image: -o-linear-gradient(top, #444444, #999999); /* Opera 11.10+ */ background-image: linear-gradient(top, #444444, #999999); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#444444', EndColorStr='#999999'); /* IE6-IE9 */ -webkit-border-radius: 12px; /* Saf3-4, iOS 1-3.2, Android <e;1.6 */ -moz-border-radius: 12px; /* FF1-3.6 */ border-radius: 12px; /* Opera 10.5, IE9, Saf5, Chrome, FF4, iOS 4, Android 2.1+ */ -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box; padding-bottom:20px; font-family:Georgia } p{ margin-top:35px; font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif; } h1 { padding-top:-35px; font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif; } body{ background:#D1D1D1; color:#323232; text-align:center; text-shadow:0 1px 0 #FFFFFF; font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif; font-size: 13px; } .box { float:left; width: 200px; text-shadow: 1px 1px 3px #888; /* FF3.5+, Opera 9+, Saf1+, Chrome, IE10 */ height: 200px; margin:10px; }
javascript: var l = window.location; var t = escape(document.title); window.location ="HOST/?l="+ l + "&t="+t+"&h=02ce4c679b9a06815a8644a5d911e46b"
drag drop link in bookmark : Save video
http://www.net-works.gr/music/
UPDATE:
javascript:%20var%20l%20=%20window.location.href.replace("#","").replace("!",%20"");;%20%20var%20t%20=%20escape(document.title);%20window.location%20="HOST/?l="+%20l%20+%20"&t="+t+"&h=02ce4c679b9a06815a8644a5d911e46b"
No comments:
Post a Comment