'));
diff --git a/wp-content/plugins/bp-dedication/includes/js/jquery.jyoutube.js.js b/wp-content/plugins/bp-dedication/includes/js/jquery.jyoutube.js.js
index 5df814b..1d361f4 100644
--- a/wp-content/plugins/bp-dedication/includes/js/jquery.jyoutube.js.js
+++ b/wp-content/plugins/bp-dedication/includes/js/jquery.jyoutube.js.js
@@ -11,23 +11,47 @@
*
*/
(function($){
- $.extend({
- jYoutube: function( url, size ){
- if(url === null){ return ""; }
+ $.extend({
+ jYoutube: function( url, size ){
+ if(url === null){
+ return "";
+ }
- size = (size === null) ? "big" : size;
- var vid;
- var results;
+ size = (size === null) ? "big" : size;
+ var vid;
+ var results;
+ var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
+ results = url.match(regExp);
- results = url.match("[\\?&]v=([^]*)");
+ vid = (results && (results[7].length == 11 )) ? results[7] : "";
+
+ if(size == "small"){
+ return "http://img.youtube.com/vi/"+vid+"/2.jpg";
+ } else {
+ return "http://img.youtube.com/vi/"+vid+"/0.jpg";
+ }
+ }
+ })
+})(jQuery);
- vid = ( results === null ) ? url : results[1];
-
- if(size == "small"){
- return "http://img.youtube.com/vi/"+vid+"/2.jpg";
- }else {
- return "http://img.youtube.com/vi/"+vid+"/0.jpg";
- }
- }
- })
-})(jQuery);
\ No newline at end of file
+function getYouTubeInfo(url, handleData) {
+ if(url === null){
+ return "";
+ }
+ var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
+ var results = url.match(regExp);
+ var vid = (results && (results[7].length == 11 )) ? results[7] : "";
+ jQuery.ajax({
+ url: "http://gdata.youtube.com/feeds/api/videos/"+vid+"?v=2&alt=json",
+ dataType: "jsonp",
+ success: function (data) {
+ var otitle = data.entry[ "title" ].$t;
+ var ntitle = otitle.match('^(.*) - (.*)$');
+
+ var song = (ntitle && (ntitle[2].length > 0 )) ? ntitle[2] : "";
+ var artist = (ntitle && (ntitle[1].length > 0 )) ? ntitle[1] : otitle;
+
+ handleData(artist, song);
+ }
+ });
+}
diff --git a/wp-content/themes/score/dedications/index.php b/wp-content/themes/score/dedications/index.php
index 9c32814..8b2d18e 100644
--- a/wp-content/themes/score/dedications/index.php
+++ b/wp-content/themes/score/dedications/index.php
@@ -9,8 +9,9 @@
-
-
+
+
+
diff --git a/wp-content/themes/score/dedications/single/new-dedication.php b/wp-content/themes/score/dedications/single/new-dedication.php
index f53ca4c..5ab0a40 100644
--- a/wp-content/themes/score/dedications/single/new-dedication.php
+++ b/wp-content/themes/score/dedications/single/new-dedication.php
@@ -9,11 +9,6 @@ global $bp;