See llms.txt for all machine-readable content.

Back to Templates

Send Russian joke comics to Telegram with OpenRouter and Google Sheets

Created by

Created by: RenegaDe || renegade
RenegaDe

Last update

Last update 6 hours ago

Categories

Share


Quick Overview

This workflow scrapes a Russian joke from anekdot.ru, uses OpenRouter (chat + image) to turn it into a single-panel comic image, posts the image with a caption to Telegram, and tracks state and deduplication in Google Sheets while storing generated images in Google Drive.

How it works

  1. Starts manually (or on a schedule if you replace the trigger) and searches Google Drive for the history Google Sheets spreadsheet, creating it (plus an images folder) on first run.
  2. Loads the last processed page from the spreadsheet’s State tab, builds the anekdot.ru tag URL, downloads the page HTML, and extracts jokes that match the target length.
  3. Reads previously used joke hashes from the Used Jokes tab and selects the first unused joke, paging through anekdot.ru (up to 15 pages) until it finds a valid unused candidate.
  4. Sends the chosen joke text to an OpenRouter chat model to extract a strict JSON description (scene, characters, and short dialogue), then assembles a safe image prompt with optional speech bubbles.
  5. Generates a square comic image via the OpenRouter Images API, and if moderation blocks the request it logs the joke as blocked in Google Sheets and retries with the next unused joke.
  6. Converts the returned base64 image to a PNG, uploads it to Google Drive, shares it publicly, and posts it to Telegram with an HTML caption containing the joke text.
  7. Appends the sent joke hash, excerpt, timestamp, and Drive image URL to the Used Jokes tab and updates the current page in State if it changed.

Setup

  1. Add credentials for OpenRouter API, Telegram, Google Sheets OAuth2, and Google Drive OAuth2 (with the Google Sheets API and Drive API enabled).
  2. Set the Telegram chat ID in the Telegram “send photo” step to your target channel/chat numeric ID.
  3. Ensure the Google Drive search name and the Google Sheets spreadsheet title match exactly (default is “Anekdot Bot — History”), or change both to your preferred name.
  4. Optionally change the anekdot.ru tag in the URL-building code (default is “вовочка”) and the Google Drive folder name where images are stored.
  5. Select an OpenRouter chat model in the OpenRouter Chat Model node (the workflow ships without a preset model).
  6. If you want automatic posting, replace the Manual Trigger with a Schedule Trigger and activate the workflow.