Public
A Slack bot that responds to messages
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

🍽️ Espoo Tofu Lunch Finder β€” Slack Bot

A Slack bot that scrapes lounaat.info for lunch dishes matching a keyword (default: tofu) and translates them from Finnish to English.

Equivalent to:

xidel -s "https://lounaat.info/02150-espoo" -e '...' | trans -b "fi:en"

How it works

Rendering mermaid diagram...
  1. scraper.ts β€” Fetches lounaat.info HTML and extracts dishes matching a keyword
  2. translate.ts β€” Translates Finnish text to English via the free MyMemory API
  3. main.ts β€” HTTP handler that wires Slack events to the scraper + translator

Usage

  • @mention the bot with a keyword: @bot tofu or @bot kana
  • DM the bot a keyword to search for
  • Visit the endpoint URL in a browser to see today's tofu dishes

Setup

  1. Create a Slack App at https://api.slack.com/apps
  2. Add Bot Token Scopes: chat:write, app_mentions:read
  3. Install to your workspace
  4. Set env vars: SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET
  5. Enable Event Subscriptions β†’ paste the val's endpoint URL
  6. Subscribe to: app_mention, message.im