Could anyone help me with this? I seem to be getting "Expected ';'" errors..
jscript code:
function YouTube_Search(Keyword,sIndex,Length,option){
var result={keyword:Keyword,VideoInfo:[],start:sIndex,end:0,total:-1};
result.start=(((result.start-1)/10)*20)+1;
>>>var api=eval(GetContents("http://gdata.youtube.com/feeds/api/videos?q="+Keyword+"&alt=json"));<<<
result.total=parseInt(api.openSearch$totalResults.$t);
while(1){
for(i in api.entry)result.VideoInfo.push({URL:"http://www.youtube.com/watch?v="+api.entry[i].id.$t.substr(api.entry[i].id.$t.lastIndexOf("/")+1),ThumbnailURL:api.entry[i].media$thumbnail[0].url,Title:api.entry[i].media$title.$t,Description:api.entry[i].media$description.$t,ViewCount:parseInt(api.entry[i].yt$statistics.viewCount),LengthSeconds:parseInt(api.entry[i].yt$duration.seconds),SaveFilename:ToFilename(api.entry[i].media$title.$t),attr:7
});
if(result.start+(result.VideoInfo.length-1)==result.total)break;
}
result.VideoInfo.length?result.end=result.start+(result.VideoInfo.length-1):result.total=0;
if(result.VideoInfo.length!=20&&result.start!=1)result.total=result.end;
return result;
}
underlined: Expected ";" error
GetContents is a XMLHTTP GET request and returns the responseText.
Basically i'm just searching youtube =P
oh and sorry for ruining the layout.