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.
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"
Rendering mermaid diagram...
- scraper.ts β Fetches lounaat.info HTML and extracts dishes matching a keyword
- translate.ts β Translates Finnish text to English via the free MyMemory API
- main.ts β HTTP handler that wires Slack events to the scraper + translator
- @mention the bot with a keyword:
@bot tofuor@bot kana - DM the bot a keyword to search for
- Visit the endpoint URL in a browser to see today's tofu dishes
- Create a Slack App at https://api.slack.com/apps
- Add Bot Token Scopes:
chat:write,app_mentions:read - Install to your workspace
- Set env vars:
SLACK_BOT_TOKEN,SLACK_SIGNING_SECRET - Enable Event Subscriptions β paste the val's endpoint URL
- Subscribe to:
app_mention,message.im