This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example output from 'Luis Fonsi - Despacito ft. Daddy Yankee (Official Music Video)' (https://www.youtube.com/watch?v=kJQP7kiw5Fk): | |
// "Max time: 51067 years; Time if all views made it to 63 seconds: 11429 years (+181 years per second)." | |
player = document.getElementById("movie_player"); | |
currentTime = player.getCurrentTime(); | |
duration = player.getDuration(); | |
views = parseInt(document.getElementsByClassName("view-count")[0].innerHTML.replace(/,/g, "")); | |
maxTimeInYears = Math.round(views * duration / 60 / 60 / 24 / 365); | |
currentPositionTimeInYears = Math.round(views * currentTime / 60 / 60 / 24 / 365); | |
yearsPerSecond = Math.round(views / 60 / 60 / 24 / 365); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Expanded on Filip Ekberg's gist: https://gist.github.com/fekberg/bac40e784113dd75c03e | |
// See his tweet @fekberg for more https://twitter.com/fekberg/status/410964845870071808 | |
// Not perfect, but still amusing. | |
using System; | |
using System.Media; | |
using System.Speech.Synthesis; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Collections.Generic; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine(new Program().M()); | |
} | |
bool M() |