Browse Source

extend instagram URL check

pull/557/head
Joe Germuska 11 years ago
parent
commit
e190a06649
  1. 4
      source/js/Core/Media/VMM.ExternalAPI.js
  2. 2
      source/js/Core/Media/VMM.MediaType.js

4
source/js/Core/Media/VMM.ExternalAPI.js

@ -1226,6 +1226,10 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
} }
return _size; return _size;
},
isInstagramUrl: function(url) {
return url.match("instagr.am/p/") || url.match("instagram.com/p/");
} }
}, },

2
source/js/Core/Media/VMM.MediaType.js

@ -89,7 +89,7 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
media.id = VMM.ExternalAPI.flickr.getFlickrIdFromUrl(d) media.id = VMM.ExternalAPI.flickr.getFlickrIdFromUrl(d)
media.link = d; media.link = d;
success = Boolean(media.id); success = Boolean(media.id);
} else if (d.match("instagr.am/p/")) { } else if (VMM.ExternalAPI.instagram.isInstagramUrl(d)) {
media.type = "instagram"; media.type = "instagram";
media.link = d; media.link = d;
media.id = d.split("\/p\/")[1].split("/")[0]; media.id = d.split("\/p\/")[1].split("/")[0];

Loading…
Cancel
Save