This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A Val Town script that automatically cross-posts Farcaster casts to Twitter/X using Neynar webhooks. It runs as a serverless HTTP endpoint on Val Town's Deno-based platform.
# Type check deno check index.ts # Run locally (for testing) deno run --allow-net --allow-env index.ts
Single-file HTTP handler (index.ts):
cast.created webhooks from Neynarimagedelivery.net and uploads natively to Twittertwitter-api-v2 npm packageKey flow:
CastCreatedWebhook payloadparent_hash !== null)Deno.env.get() for environment variablesnpm: prefix (e.g., npm:twitter-api-v2)export default async function(req: Request): Promise<Response>TWITTER_API_KEYTWITTER_API_SECRETTWITTER_ACCESS_TOKENTWITTER_ACCESS_TOKEN_SECRETTwitter API keys must have OAuth 1.0a with Read/Write permissions configured.