Cam ce anume trebuia sa faca script-ul ?
Uite un script sa aduci pe o pagina toate clipurile unui anumit user:
Atentie! Intr-un anumit punct trebuie sa schimbi 'java script' cu 'javascript'. Site-ul softpedia modifica textul.
Ca sa aduci clipurile video al altui user trebuie sa schimbi 'failblog' cu numele user-ui care vrei.
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<style type="text/css">
.titlec {
font-size: small;
}
ul{
margin-left:0px;
list-style-type: none;
}
ul.videos li {
width: 640px;
margin-bottom: 1em;
}
ul.videos
{
margin-bottom: 1em;
padding-left : 10px;
margin-left: 0em;
list-style: none;
}
</style>
<script type="text/javascript" src="http://swfobject.googlecode.com/svn/trunk/swfobject/swfobject.js"></script>
<script type="text/javascript">
function loadVideo(playerUrl, autoplay) {
swfobject.embedSWF(
playerUrl + '&rel=1&border=0&fs=1&autoplay=' +
(autoplay?1:0), 'player', '640', '380', '9.0.0', false,
false, {allowfullscreen: 'true'});
}
function showMyVideos2(data) {
var html = ['<ul class="videos">'];
var i=0;
var title ="";
var thumbnailUrl ="";
var playerUrl ="";
var desc="";
var rating="";
var views="";
var count=data.count;
while (i<count) {
title = data.value.items[i].title.substr(0, 60);
thumbnailUrl = data.value.items[i]["media:group"]["media:thumbnail"][0].url;
playerUrl = data.value.items[i]["media:group"]["media:content"][0].url;
desc=data.value.items[i]["media:group"]["media:description"].content.substr(0, 300);
try{rating=Math.round(data.value.items[i]["gd:rating"].average);}
catch(err){rating='N/A';}
try{views=data.value.items[i]["yt:statistics"].viewCount;}
catch(err){views='N/A';}
html.push('<li>', '<div style="float:left;padding-right:15px;"><img src="',
thumbnailUrl, '" width="130" height="97"/><br />',rating,' * and ',views,' views</div>',
'<a style="padding-left:25px;" href="java script:void(0);" onclick="loadVideo(\'', playerUrl, '\', true)" class="titlec">', title, '...</a><br />',desc,'<br style="clear:both"/>','</li>');
i++;}
html.push('</ul><br style="clear: left;"/>');
document.getElementById('videos2').innerHTML = html.join('');
if (i.length > 0) {
loadVideo(data[i].value.items[0]["media:group"]["media:content"][0].url, false);
}
}
</script>
</head>
<body style="background-color:white">
<div id="playerContainer" style="width: 640px; height: 380px;background-color:black;">
<object id="player" width="1px" height="1px" ></object>
</div> <br />
<div id="videos2" style="width:640px;overlow:auto"></div>
<script
type="text/javascript"
src="http://pipes.yahoo.com/pipes/pipe.run?_id=69a422756507d1c1fd47a3f6ffd03209&_render=json&user=failblog&_callback=showMyVideos2">
</script>
</body>
</html>