mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
opengraph 제거
This commit is contained in:
parent
f36724a96f
commit
26d4fe976e
1 changed files with 0 additions and 48 deletions
|
|
@ -949,54 +949,6 @@
|
||||||
new $.fn.oembed.OEmbedProvider("polar", "rich", ["polarb\\.com/.+"], "http://assets-polarb-com.a.ssl.fastly.net/api/v4/publishers/unknown/embedded_polls/iframe?poll_id=$1", {templateRegex: /.*polarb\.com\/polls\/(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}),
|
new $.fn.oembed.OEmbedProvider("polar", "rich", ["polarb\\.com/.+"], "http://assets-polarb-com.a.ssl.fastly.net/api/v4/publishers/unknown/embedded_polls/iframe?poll_id=$1", {templateRegex: /.*polarb\.com\/polls\/(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}),
|
||||||
new $.fn.oembed.OEmbedProvider("ponga", "rich", ["ponga\\.com/.+"], "https://www.ponga.com/embedded?id=$1", {templateRegex: [/.*ponga\.com\/embedded\?id=(\w+).*/, /.*ponga\.com\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}),
|
new $.fn.oembed.OEmbedProvider("ponga", "rich", ["ponga\\.com/.+"], "https://www.ponga.com/embedded?id=$1", {templateRegex: [/.*ponga\.com\/embedded\?id=(\w+).*/, /.*ponga\.com\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}),
|
||||||
|
|
||||||
//Use Open Graph Where applicable
|
|
||||||
new $.fn.oembed.OEmbedProvider("opengraph", "rich", [".*"], null,
|
|
||||||
{
|
|
||||||
yql: {
|
|
||||||
xpath: "//meta|//title|//link",
|
|
||||||
from: 'html',
|
|
||||||
datareturn: function (results) {
|
|
||||||
if (!results['og:title'] && results['title'] && results['description'])
|
|
||||||
results['og:title'] = results['title'];
|
|
||||||
|
|
||||||
if (!results['og:title'] && !results['title'])
|
|
||||||
return false;
|
|
||||||
|
|
||||||
var code = $('<p/>');
|
|
||||||
if (results['og:video']) {
|
|
||||||
var embed = $('<embed src="' + results['og:video'] + '"/>');
|
|
||||||
embed.attr('type', results['og:video:type'] || "application/x-shockwave-flash")
|
|
||||||
.css('max-height', settings.maxHeight || 'auto')
|
|
||||||
.css('max-width', settings.maxWidth || 'auto');
|
|
||||||
if (results['og:video:width'])
|
|
||||||
embed.attr('width', results['og:video:width']);
|
|
||||||
if (results['og:video:height'])
|
|
||||||
embed.attr('height', results['og:video:height']);
|
|
||||||
code.append(embed);
|
|
||||||
} else if (results['og:image']) {
|
|
||||||
var img = $('<img src="' + results['og:image'] + '">');
|
|
||||||
img.css('max-height', settings.maxHeight || 'auto').css('max-width', settings.maxWidth || 'auto');
|
|
||||||
if (results['og:image:width'])
|
|
||||||
img.attr('width', results['og:image:width']);
|
|
||||||
if (results['og:image:height'])
|
|
||||||
img.attr('height', results['og:image:height']);
|
|
||||||
code.append(img);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (results['og:title'])
|
|
||||||
code.append('<b>' + results['og:title'] + '</b><br/>');
|
|
||||||
|
|
||||||
if (results['og:description'])
|
|
||||||
code.append(results['og:description'] + '<br/>');
|
|
||||||
else if (results['description'])
|
|
||||||
code.append(results['description'] + '<br/>');
|
|
||||||
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
];
|
];
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
//This is needed for gravatar :(
|
//This is needed for gravatar :(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue