diff --git a/php/footer.php b/php/footer.php index d785fa97..c9c06106 100755 --- a/php/footer.php +++ b/php/footer.php @@ -23,12 +23,12 @@
-
Share on Facebook
+
Share on Facebook
-
Share on Twitter
+
Share on Twitter
diff --git a/static/js/admin.js b/static/js/admin.js index 86ede176..539551bd 100755 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -50,7 +50,7 @@ socket.on("pw", function(msg) refresh_scroll(); localStorage.setItem(chan.toLowerCase(), msg); - Materialize.toast("Correct password. You now have access to the sacred relam of The Admin.", 4000); + Materialize.toast("Correct password. You now have access to the sacred realm of The Admin.", 4000); }); socket.on(chan.toLowerCase()+",conf", function(msg) diff --git a/static/js/search.js b/static/js/search.js index d9d758d6..66a984c8 100755 --- a/static/js/search.js +++ b/static/js/search.js @@ -125,59 +125,44 @@ function search(search_input){ if(search_input !== ""){ var keyword= encodeURIComponent(search_input); - //response= http://nixo.no/txt/?4574f9b9dd286e0d#X+kzTvyFv5IrdkGQtqmoquhekDRCPJX9N24PSn86CFE= - //var yt_url = "https://www.googleapis.com/youtube/v3/search?videoEmbeddable=true&part=snippet&q=thefatrat&fields=items(id%2Csnippet)&type=video&videoDuration=medium&videoCategoryId=15&key=AIzaSyC3hq93zqwdwcjO8HyD9oToLLFotoAjyWo"; - var yt_url='http://gdata.youtube.com/feeds/api/videos?q='+keyword+'&format=5&orderby=relevance&max-results=30&v=2&alt=jsonc'; + //response= x + var yt_url = "https://www.googleapis.com/youtube/v3/search?key=***REMOVED***&videoEmbeddable=true&part=id&fields=items(id)&type=video&order=viewCount&safeSearch=none&maxResults=25"; + yt_url+="&q="+keyword; + if(music)yt_url+="&videoCategoryId=25"; + + var vid_url = "https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key=***REMOVED***&id="; $.ajax({ type: "GET", url: yt_url, dataType:"jsonp", - success: function(response) + success: function(response){ + if(response.items){ + //get list of IDs and make new request for video info + $.each(response.items, function(i,data) { - if(response.data.items) + vid_url += data.id.videoId+","; + }); + console.log(vid_url) + + $.ajax({ + type: "GET", + url: vid_url, + dataType:"jsonp", + success: function(response){ + $.each(response.items, function(i,song) { - var wrapper = ""; - z = 0; - $.each(response.data.items, function(i,data) - { - if(data.duration > 720 && longsongs == true){return;} - if(data.category == "Music" || music == false){ - var video_title=encodeURIComponent(data.title).replace(/'/g, "\\\'"); - var views=data.viewCount; - var video_thumb = "http://i.ytimg.com/vi/"+data.id+"/default.jpg"; - var length = Math.floor(data.duration/60)+":"+(data.duration-Math.floor(data.duration / 60)*60); - var finalhtml="\ -