Now when I’m browsing the web, I can press cmd-J (Browserflow’s keyboard shortcut) and choose “Roam: Save URL” from the typeahead to save the current URL to my Roam Daily Notes page.
If there’s not already a “Saved URLs:” block on daily notes, it makes it. Then it nests the URL beneath.
Here’s what the flow looks like in action:
Here’s what the flow itself looks like:
Notice there are really only two meaningful lines of code:
let urls = await getOrCreateBlockOnPage($page, 'Saved URLs:', -1); await createChildBlock(urls, $url)
The first line creates the “Saved URLs:” block, but only if it doesn’t already exist. It returns the uid of that block. The second line saves the url. Nothing else to it!