SmartBlocks
SmartBlocks copied to clipboard
Wikipedia SmartBlock
✂️ Copy of your #42SmartBlock from Roam
Download the zip, extract the json and import into your Roam Research graph. Wikipedia SB 0.5.zip
📋 Describe the SmartBlock
This SmartBlock obtains the page title and then searches Wikipedia for results. It then presents a series of buttons for you to select the right results. The SB then obtains the extract and primary image for that Wikipedia page and displays them in your RR page. The sentence length of the extract is configurable. CSS is provided and this needs to be copied into your roam/css page.
✅ Describe any prerequisites or dependencies that are required for this SmartBlock
Roam42. Nil other, no API token required. Provided CSS to be copied into roam/css page.
📷 Screenshot of your #42SmartBlock workflow/template from Roam
💡 Additional Info
This is great. One element I miss is a link back to the Wikipedia page as often I'm keen to look up more.
👍👍
@kmaustral
That is a very good idea. See updated zip file in first post.
This version also offers the option to define the search mode.
Page Title
will automatically search for the page title on Wikipedia as before.
Prompt
will trigger a pop-up that you can type your search query into.
Cheers!
That works well Mark. Without being too picky, when you're doing the next version, maybe populate the dialogue with the page title on the "Prompt" setting. Often the page names need just a little tweak, like removing "Zettel/" to work. Much appreciated, mate.
Thanks, @kmaustral.
Updated version in the first post which includes your excellent suggestion.
Thanks!
Great.
Updated version in the first post. Fixes a script crash if there is no hero image available for download.
Hi, mlava! Thanks for your SB: it really helps me in my research work (until now I used the "iref" thing into my pages...).
May I suggest to add a "Select Wikipedia language" option in a future release? It would greatly help, as I often find myself in the need to search in IT, FR and/or EN Wikipedia.
Thanks again for your work!
Great extension, thanks!
To make the menu of search results clickable straight away, I added these lines to the bottom of the main Wikipedia SB:
await roam42.common.sleep(500);
await roam42KeyboardLib.pressEsc(200);
New version in first post.
Updated to:
- use roam.alpha write API
- fix some bugs
- make menu clickable without needing to click away first