New Mehdown Embeds

19

We’ve added some new embeds to v2.34 of Mehdown (our open source Markdown parser).

Apple Music

A while back, I was looking for options to make @JasonToon’s Sunday playlist posts a bit better that he had be piecing together with YouTube embeds. During that exploration I stumbled across Apple Music embeds which I don’t expect to get much use but they were easy enough to add.

You can get an Apple Music URL from iTunes:
enter image description here

And if you paste that URL into a post here we’ll render it as an embed:

GitHub Gists

This one comes from a little contribution @meverett worked on. He added the ability to render GitHub Gist URLs as embeds which would have come in handy back when we won @mfladd a trip to Disney World by coding little algorithms to fill out March Madness brackets.

function(game, team1, team2) {
var percentages = {
round5: { 1: 100, 2: 94, 3: 85, 4: 78, 5: 68, 6: 66, 7: 60, 8: 48, 9: 52, 10: 40, 11: 34, 12: 35, 13: 22, 14: 15, 15: 6, 16: 0 },
round4: { 1: 87, 2: 69, 3: 61, 4: 56, 5: 52, 6: 51, 7: 27, 8: 18, 9: 8, 10: 46, 11: 38, 12: 49, 13: 24, 14: 12, 15: 14, 16: 0 },
round3: { 1: 79, 2: 72, 3: 50, 4: 35, 5: 21, 6: 33, 7: 37, 8: 70, 9: 40, 10: 33, 11: 33, 12: 5, 13: 0, 14: 0, 15: 0, 16: 0 },
round2: { 1: 59, 2: 46, 3: 47, 4: 72, 5: 75, 6: 23, 7: 0, 8: 57, 9: 50, 10: 0, 11: 60, 12: 0, 13: 0, 14: 0, 15: 0, 16: 0 },
round1: { 1: 57, 2: 48, 3: 64, 4: 23, 5: 50, 6: 67, 7: 0, 8: 50, 9: 0, 10: 0, 11: 0, 12: 0, 13: 0, 14: 0, 15: 0, 16: 0 },
round0: { 1: 67, 2: 33, 3: 44, 4: 33, 5: 0, 6: 50, 7: 0, 8: 50, 9: 0, 10: 0, 11: 0, 12: 0, 13: 0, 14: 0, 15: 0, 16: 0 }
};
var lowerSeededTeam = team1;
var higherSeededTeam = team2;
if (team1.seed === team2.seed) {
// If the seeds of two teams are the same, use the team's rank
if (team2.official_rank < team1.official_rank) {
lowerSeededTeam = team2;
higherSeededTeam = team1;
}
} else if (team2.seed < team1.seed) {
lowerSeededTeam = team2;
higherSeededTeam = team1;
}
// Get the winning percentage for the lower seeded team based on round
var percentage = percentages['round' + game.round][lowerSeededTeam.seed];
// Add the delta of the team's rpi * winning percentage
percentage += (lowerSeededTeam.rpi * lowerSeededTeam.win_pct - higherSeededTeam.rpi * higherSeededTeam.win_pct) * 100;
// Add the delta of the team's 3-point percentage
percentage += (lowerSeededTeam.three_point_pct - higherSeededTeam.three_point_pct) * 1;
// Add the delta of the team's field goal percentage
percentage += (lowerSeededTeam.field_goal_pct - higherSeededTeam.field_goal_pct) * 1;
// Add the delta of the team's free throw percentage
percentage += (lowerSeededTeam.free_throw_pct - higherSeededTeam.free_throw_pct) * 1;
// Generate a random number between 0 and 100
var random = Math.round(Math.random() * 100);
if (random <= percentage) {
// Lower seeded team wins game
lowerSeededTeam.winsGame();
} else {
// Upset: higher seeded team wins game
higherSeededTeam.winsGame();
}
}
view raw gistfile1.js hosted with ❤ by GitHub

Twitch

Our own @ThomasF has been using the Twitch embed we built to play games on Sunday nights with the Meh community.

If you drop a Twitch URL into our forums you get a video player and a chat room:

Woot Forums

You can now take the permalink of any Woot forum post and paste it here and we’ll render it:

Snapster


quality posts: 16 Private Messages Snapster

Come 'n listen to my story 'bout a man named Jeb,
an early woot buyer, had quite the hot head
and then one day, a cheap scanner did arrive
he said this ain't a keyboard, I don't like this woot jive

fraud that is, bamboozlement, treachery

XKCD

This one comes from a little contribution @schuette worked on. You can take the permalink to any XKCD comic and paste it here: