Skip to content

Instantly share code, notes, and snippets.

View codewithcheese's full-sized avatar

Tom Manning codewithcheese

View GitHub Profile
@codewithcheese
codewithcheese / Clip YouTube to Logseq.js
Last active June 16, 2022 15:14
Clip YouTube to Logseq
// make bookmarklet with https://promincproductions.com/devtools/bookmarklet-generator/
function clipVideo () {
const title = ytplayer.config.args.title;
const person = ytplayer.config.args.author;
const url = "https://www.youtube.com/watch?v=" + ytplayer.config.args.video_id;
const text = `- 🎥️\nTitle:: ${title}\nChannel:: ${person}\n\t- Embed\n{{video ${url}}}\n\t- Notes`;
const type = "text/plain";
const data = [new ClipboardItem({ [type]: text })];
navigator.clipboard.write(data).then(() => {