diff --git a/html/watch.ejs b/html/watch.ejs index 63001b06..0f6b9017 100644 --- a/html/watch.ejs +++ b/html/watch.ejs @@ -45,26 +45,53 @@ +<% + const desc = `Watch this ${turntomins(VideoData?.lengthSeconds) || "LIVE"} long video from ${VideoData?.author} On Poke! +👍 ${convert(engagement?.likes)} | 👎 ${convert(engagement?.dislikes)} | 📈 ${convert(engagement?.viewCount)} Views 🗓️ ${date.replace("Premiered", " ")} 💬 ${!isNaN(inv.commentCount) ? inv.commentCount.toLocaleString() : 0}`; + + const image = `https://i.ytimg.com/vi/${VideoData.videoId}/maxresdefault.jpg`; + const url = `https://${hostname}/watch?v=${VideoData?.videoId}`; + const title = `${VideoData?.title} | Poke`; + + const twitterTags = [ + { name: "twitter:author", content: VideoData?.author }, + { name: "twitter:url", content: url }, + { name: "twitter:title", content: title }, + { name: "twitter:description", content: desc }, + { name: "twitter:image", content: image }, + { name: "twitter:card", content: "summary_large_image" }, + ]; + + const facebookTags = [ + { property: "facebook:title", content: title }, + { property: "facebook:description", content: desc }, + { property: "facebook:image", content: image }, + ]; + + const ogTags = [ + { property: "og:title", content: title }, + { property: "og:type", content: "video.other" }, + { property: "og:url", content: url }, + { property: "og:description", content: desc }, + { property: "og:image", content: image }, + ]; +%> + - - - - long video from <%=VideoData?.author%> On Poke! -👍 <%=convert(engagement?.likes)%> | 👎 <%=convert(engagement?.dislikes)%> | 📈 <%=convert(engagement?.viewCount)%> Views 🗓️ <%= date.replace("Premiered", " ") %> 💬 <% if (!isNaN(inv.commentCount)) { %><%= inv.commentCount.toLocaleString() %><% } else { %>0<% } %>" name="twitter:description"> - - - - - long video from <%=VideoData?.author%> On Poke! -👍 <%=convert(engagement?.likes)%> | 👎 <%=convert(engagement?.dislikes)%> | 📈 <%=convert(engagement?.viewCount)%> Views 🗓️ <%= date.replace("Premiered", " ") %> 💬 <% if (!isNaN(inv.commentCount)) { %><%= inv.commentCount.toLocaleString() %><% } else { %>0<% } %>"> - - - - - - long video from <%=VideoData?.author%> On Poke! -👍 <%=convert(engagement?.likes)%> | 👎 <%=convert(engagement?.dislikes)%> | 📈 <%=convert(engagement?.viewCount)%> Views 🗓️ <%= date.replace("Premiered", " ") %> 💬 <% if (!isNaN(inv.commentCount)) { %><%= inv.commentCount.toLocaleString() %><% } else { %>0<% } %>"> - +<% twitterTags.forEach(tag => { %> + +<% }) %> + + +<% facebookTags.forEach(tag => { %> + +<% }) %> + + +<% ogTags.forEach(tag => { %> + +<% }) %> + <% } %>