Steps
- Open Extensions → Apps Script in your sheet
- Paste the script and set your API key
- Run it or add a time-based trigger
Example (javascript)
function postRow() {
const [title, html] = SpreadsheetApp.getActiveSheet().getRange("A2:B2").getValues()[0];
UrlFetchApp.fetch("https://blogjh.lovable.app/api/public/v1/posts", {
method: "post", contentType: "application/json",
headers: { Authorization: "Bearer bpk_live_YOUR_KEY" },
payload: JSON.stringify({ title, html, is_draft: true }),
});
}FAQ
Where do I keep the API key?
Use Apps Script Project Properties instead of writing it in the sheet.
