• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
hno

hno

farcaster-autoPostToX

Remix of artivilla/farcaster-autoPostToX
Public
Like
farcaster-autoPostToX
Home
Code
6
.vtignore
AGENTS.md
CLAUDE.md
README.md
deno.json
H
index.ts
Environment variables
4
Branches
1
Pull requests
Remixes
History
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.
Sign up now
Code
/
CLAUDE.md
Code
/
CLAUDE.md
Search
1/3/2026
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

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.

Development Commands

# Type check deno check index.ts # Run locally (for testing) deno run --allow-net --allow-env index.ts

Architecture

Single-file HTTP handler (index.ts):

  • Receives cast.created webhooks from Neynar
  • Filters out replies (only cross-posts original casts)
  • Downloads images from imagedelivery.net and uploads natively to Twitter
  • Appends video/other URLs to tweet text (relies on Twitter unfurling)
  • Posts to Twitter using twitter-api-v2 npm package

Key flow:

  1. Webhook POST → parse CastCreatedWebhook payload
  2. Skip if reply (parent_hash !== null)
  3. Separate embeds: images → upload to Twitter; videos/URLs → append to text
  4. Validate 280 char limit
  5. Tweet via Twitter API v2

Platform Notes (Val Town/Deno)

  • Uses Deno.env.get() for environment variables
  • Imports npm packages via npm: prefix (e.g., npm:twitter-api-v2)
  • HTTP trigger pattern: export default async function(req: Request): Promise<Response>
  • TypeScript with strict mode enabled

Required Environment Variables

  • TWITTER_API_KEY
  • TWITTER_API_SECRET
  • TWITTER_ACCESS_TOKEN
  • TWITTER_ACCESS_TOKEN_SECRET

Twitter API keys must have OAuth 1.0a with Read/Write permissions configured.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.