diff --git a/js/plugins.js b/js/plugins.js index 4febfc3..0f356ce 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -351,8 +351,36 @@ plugins.factory('userPlugins', function() { ); gistPlugin.name = 'Gist'; + var tweetPlugin = new Plugin( + urlPlugin(function(url) { + var regexp = /^https?:\/\/twitter\.com\/(?:#!\/)?(\w+)\/status(?:es)?\/(\d+)/i; + var match = url.match(regexp); + if (match) { + url = 'https://api.twitter.com/1/statuses/oembed.json?id=' + match[2]; + return function() { + var element = document.querySelector('.embed_' + this.$$hashKey); + jsonp(url, function(data) { + // sepearate the HTML into content and script tag + var scriptIndex = data.html.indexOf("