Skip to content

Instantly share code, notes, and snippets.

@PatheticMustan
Created February 14, 2025 04:28
Show Gist options
  • Save PatheticMustan/82099ede01775ba2902ed420d806d102 to your computer and use it in GitHub Desktop.
Save PatheticMustan/82099ede01775ba2902ed420d806d102 to your computer and use it in GitHub Desktop.
just a small idea
words = "my name is".split(" ").map(v => v.toLowerCase());
urls = words.map(word => x.find(v => word.indexOf(v.clean_text.toLowerCase()) !== -1)).filter(v => v !== undefined).map(v => v.url);
let content = "";
urls.map(url => {
let embedlink = "http://www.youtube.com/embed/" + url.split("?v=")[1];
content += `<iframe width="560" height="315" src="${embedlink}?controls=0&autoplay=1&loop=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>`
});
document.body.innerHTML = content;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment