Home > Reflections | โฎ๏ธ โญ๏ธ
2025-04-13 | ๐ช Empower ๐ฅ People
๐ Books
- The Bullet Journal Method: Track the Past, Order the Present, Design the Future
- ๐จโ๐ The Self-Driven Child: The ๐ฌ Science and ๐ค Sense of Giving Your Kids More ๐น๏ธ Control Over Their Lives
- ๐ฆ Why Zebras Donโt Get Ulcers: The Acclaimed Guide to Stress, Stress-Related Disease, and Coping
- ๐ฅ Twilight of Democracy: ๐ The Seductive Lure of Authoritarianism
- ๐ฅโ๏ธ๐๏ธ The People vs. Democracy: Why Our ๐ฝ Freedom Is in โ ๏ธ Danger and How to Save It
- ๐๏ธโ๏ธโฌ๏ธ Democracy Awakening: ๐ Notes on the State of ๐บ๐ธ America
- ๐น The Origins of Totalitarianism
- ๐๏ธโก๏ธ๐ How to Lose a Country: The 7 Steps from Democracy to Dictatorship
- ๐๏ธ๐ก๏ธ Democracy or Else: How to Save America in 10 Easy Steps
- ๐๐ค The Bill of Obligations: The Ten Habits of Good Citizens
- ๐ฅโ๏ธ๐ How to Stand Up to a Dictator: The Fight for Our Future
๐ค๐ค๐ An AI Book Report Template
- ๐ป This is the Obsidian templater template Iโm currently using for AI book reports.
- โ I use the QuickAdd plugin to call the template.
- ๐ฑ I use the Commander plugin to put a button on my mobile toolbar
- ๐ ๏ธ Itโs not a perfect work of software craftsmanship; just a practical script that streamlined and automates.
- โ I think itโs working pretty well!
- โ๏ธ Workflow
- โ Click the plus button on my mobile toolbar (bringing up the QuickAdd menu)
- ๐ Choose book from the menu
- ๐ Paste the name of a book (no colons due to filename restrictions) into the text box
- โณ Wait several long seconds (less than a minute, but thereโs a definite time delay)
- ๐ฐ Profit!
- ๐ค The template will
- ๐ create a new file named after the book (in kebab-case)
- โ๏ธ set up some frontmatter (yaml at the top of the markdown file) and boilerplate text and links
- ๐ฃ๏ธ Call the Gemini API asking for a book report (see the prompt below)
- ๐ฐ using a newer model with a relatively low rate limit & daily cap
- โจ Send the result back to Gemini to Emojify it
- โก using a good standard model with a very generous rate limit and daily cap
- ๐งน Clean up some whitespace
- โ๏ธ Insert the result into the new note
- ๐ (QuickAdd adds a link to the new file wherever my cursor was)
- โ๏ธ After that, I may do some light editing, pick some nice emojis for the title, etc - but itโs largely ready to go
- ๐ All you need is a (free) Gemini API key.
<%*
const filename = tp.file.title
const kebabCase = filename
.toLowerCase()
.replaceAll("'", '')
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '')
%>---
share: true
aliases:
- "<% filename %>"
title: "<% filename %>"
URL: https://bagrounds.org/books/<%kebabCase%>
Author:
tags:
---
[[index|Home]] > [[/books/index|Books]]
# <% filename %>
<%*
async function generateTextFromGemini(prompt, apiKey, model = "gemini-2.0-flash", search = false) {
const apiUrl = `https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent?key=${apiKey}`;
const body = {
"contents": [
{
"parts": [
{"text": prompt }
]
}
],
"tools": [
{
"google_search": {}
}
]
};
if (!search) delete body.tools
const response = await fetch(apiUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
const { parts } = data.candidates[0].content;
return (parts[1] || parts[0]).text;
}
const GEMINI_API_KEY = "https://ai.google.dev/gemini-api/docs/api-key"; // Replace with your actual API key.
const prompt = `Write a markdown-formatted (start headings at level H2) book report, followed by a plethora of additional similar, contrasting, and creatively related book recommendations on ${filename}. Be thorough in content discussed but concise and economical with your language. Structure the report with section headings and bulleted lists to avoid long blocks of text.`;
const emojifyPrompt = report => `Enhance the selected markdown content by inserting relevant emojis: "${report}".
Each emoji should go before the word, phrase, or sentence it represents, followed by a space.
Put at least 1 emoji at the beginning of each section heading, bullet point, or line of text.
Insert emojis in long blocks of text.
Only return the text with the emojis.
Ensure the placement of emojis doesn't conflict with markdown syntax.`;
const model = 'gemini-2.5-pro-exp-03-25'
// const model = 'gemini-2.0-flash-thinking-exp-01-21'
try {
const report = await generateTextFromGemini(prompt, GEMINI_API_KEY, model, true);
const emojified = await generateTextFromGemini(emojifyPrompt(report), GEMINI_API_KEY);
const clean = emojified
.replaceAll(/(?<!^ *)( +)/gm, ' ')
.replaceAll(/ +$/gm, '')
.replaceAll(/\n\n\n+/g, '\n\n')
tR += clean;
} catch (error) {
tR += `Error: ${error.message}`;
}
%>
## ๐ฌ [[software/gemini|Gemini]] Prompt (<% model %>)
> <% prompt %>.
<%*
await tp.file.rename(kebabCase)
%>
๐คช Emojify Template
- ๐ค Choosing and ๐ฑ๏ธ inserting the ๐ perfect emojis can be ๐ซ tedious.
- ๐ฅณ Luckily,
๐๐คSkynet๐๐ค Gemini is pretty ๐ good with emojis. - Similar to above, I use ๐จโโ๏ธ Commander to put a ๐ฒ๏ธ button with a ๐จ custom icon on my ๐ฑ mobile toolbar
- ๐ Select text. ๐ Tap button. โจ Emojify.
<%*
async function generateTextFromGemini(prompt, apiKey, model = "gemini-2.0-flash") {
const apiUrl = `https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent?key=${apiKey}`;
const requestBody = {
contents: [{ parts: [{ text: prompt }] }],
};
try {
const response = await fetch(apiUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(requestBody),
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status} - ${JSON.stringify(await response.json(), null, 1)}`);
}
const data = await response.json();
return data.candidates[0].content.parts[0].text;
} catch (error) {
return `Error: ${error.message}`;
}
}
const GEMINI_API_KEY = "https://ai.google.dev/gemini-api/docs/api-key"; // Replace with your actual API key.
const selectedText = tp.file.selection();
if (selectedText) {
const prompt = `Enhance the selected text by inserting relevant emojis: "${selectedText}".
Each emojis should go before the word, phrase, or sentence it represents, followed by a space.
Put at least 1 emoji at the beginning of each section heading, bullet point, or line of text.
Insert lots of emojis in long blocks of text.
Only return the text with the emojis.`;
const emojifiedText = await generateTextFromGemini(prompt, GEMINI_API_KEY);
if (emojifiedText) {
tR = emojifiedText;
} else {
tR += "Failed to emojify text.";
}
} else {
tR += "Please select some text to emojify.";
}
%>
๐ช Reflections
- โ How much value can we get from an AI generated ๐ค book report ๐?
- ๐ค Maybe 10% of the value of the full read in โฆ
- ๐ Strongmen: Mussolini to the Present is 9h 42m on audible. ๐ง
- โฑ๏ธ The read time plugin claims my AI book report ๐ is a 7 minute read.
- ๐งฎ (9 * 60 + 42 = 582) / 7 = 83
- โณ โฆ 1/83rd the time?
- ๐ Thatโs something like 8x leverage.
- ๐ Not bad.
- ๐ And the Gemini API is free.
- ๐ค Maybe 10% of the value of the full read in โฆ
- ๐ How much value can be created by freely sharing these AI book reports ๐ online?
- ๐ According to the Google Search Console, traffic ๐ฑ๏ธ (clicks when it comes up in search results) to my website ๐ป has grown from 3 per week to 23 per week over the past 3 months.
- ๐ Thatโs a growth rate of (23 - 3) / 3 ~= 7 additional clicks per month.
- ๐ฎ Extrapolating with linear growth, I might have (23 + 36 x 7 =275) clicks per week 3 years from now.
- โ Integrating (summing) over time, that yields (Gemini pause for LaTex) = 5513 (Thanks Wolfram Alpha!) clicks over the next 3 years.
- โ๏ธ๐ See the bug in this calculation?
- ๐ค Assuming 1% of my visitors actually read a single AI generated ๐ค book report ๐ (and the rest read nothing), thatโs 55 AI book reports read.
- ๐คฏ โฆdo I get to multiply my earlier 8x leverage per book ๐ by 55 people ๐งโ๐คโ๐ง, yielding 440x?
- โ What units does this leverage take on? Book ๐ knowledge dissemination rate?
- ๐ค Not sureโฆ
- ๐ณ๏ธ Maybe thatโs 55 more slightly better informed voters by our next election?
- โค๏ธโ๐ฉน That probably wonโt do much on its own, but itโs a contribution.
- ๐คช Emojify! ๐ช
- ๐ง Reviews the aboveโฆ
- ๐ Bug report: I mixed weeks and months! ๐๏ธ
- ๐งฎ I shouldnโt be summing to 36. ๐ค
- ๐๏ธ It should be 3 years x 12 months per year x 4 weeks per month (or more accurately, ๐ 52 weeks per year x 3 years) = 156
- ๐ So = 89,333 ! ๐คฏ
- ๐ With the 1% reading rate, we now get 893 more slightly better informed voters by next election. ๐ณ๏ธ
- ๐ Which, to be honest, is qualitatively about as disappointing as 55. ๐
- ๐ And theyโre probably not in swing states. ๐บ๏ธ
- ๐ป Though maybe I could check readership by state in the Google Search Console. ๐ด Not tonight though.
- ๐ฏ Okay, maybe my next goal should be to figure out how to inject some exponential growth into this formula. ๐
- ๐ Things grow ๐ exponentially when they go ๐ฆ viral and ๐ฃ๏ธ people share ๐ things with their ๐งโ๐คโ๐ง friends and ๐จโ๐ฉโ๐งโ๐ฆ family.
- ๐ฐ Making that happen is the subject keeping many would-be ๐ค billionaires ๐ป busy at ๐ข startups.
- ๐ But there are plenty of books on the subjectโฆ
๐ฆ Tweet
Hereโs the catchiest tweet I could workshop with AI assistance. ๐ค Letโs see what happens!
๐๏ธ Supercharge your ๐ learning with my ๐๏ธ FREE Obsidian ๐ค AI ๐ book report template! Generate quality, emojified ๐ช๐ reports in โก seconds, powered by Google's Gemini API. See examples like ๐ How to Stand Up to a Dictator: โ๏ธ The Fight for Our Future.https://t.co/tPwHNOd2lk
โ Bryan Grounds (@bagrounds) April 14, 2025