A vibe coded Go daemon that publishes Hitchwiki and Hitchmap content to Nostr relays.
It fetches a recent sqlite dump from hitchmap and then posts these notes as kind 34242 onto some nostr relays. Kinds 3xxxx are replaceable notes. (42 is the answer to everything.)
Nostrhitch also fetches recent changes across the different hitchwiki languages and posts them as (currently) kind 1 notes.
Hitchhikers will soon(tm) be able to see these notes and add new spots at https://maps.hitchwiki.org/ The nostr maps code for this lives at https://github.com/hitchwiki/hitchmap-nostr
See also https://hitchwiki.org/en/User:Nostrhitch
# Build
go build -o nostrhitch-daemon main.go
# Configure
cp config.json.example config.json
# Edit config.json with your nsec key and relay URLs
# Run
./nostrhitch-daemon -once # Test once
./nostrhitch-daemon -dry-run # Test without posting
./nostrhitch-daemon # Run daemon# Run with Docker
docker-compose up -d
# View logs
docker-compose logs -f
# Reload after config changes
docker-compose restartEdit config.json:
{
"nsec": "your_nsec_key_here",
"post_to_relays": true,
"relays": ["wss://relay.hitchwiki.org"],
"hw_interval": 300,
"hitch_interval": 86400,
"secret_hitchwiki_url": "http://hitchwiki-alternative.example.net"
}- Multi-language: Fetches from 17 Hitchwiki language versions
- Duplicate Prevention: Two-tier system prevents reposting
- Geo Tags: Automatic location detection and plus codes
- Persistent Storage: SQLite database survives container restarts
- NIP-05 Verification: Automatic profile management
- Event Types: Hitchwiki uses kind 1 (text notes), Hitchmap uses kind 34242
The bot uses a robust two-tier system to avoid posting duplicates:
- In-memory map: Tracks notes posted during current session
- Immediate prevention: Skips already processed entries
- Startup scan: Queries all relays for existing notes at startup
- Persistent detection: Uses RSS entry IDs and database record IDs as unique keys
- Cross-session: Prevents duplicates even after bot restarts
- Hitchwiki: Uses RSS entry ID (full diff URL) as unique key
- Hitchmap: Uses database record ID with
hitchmap_prefix - Nostr tags:
rtag contains reference URL for future duplicate detection
The bot publishes two different types of Nostr events:
- Kind: 1 (text note)
- Content: Formatted as "📝 Author edited URL 📄 #hitchhiking"
- Tags:
rtag: Full diff URL for duplicate checkingsummarytag: HTML summary from RSS feedttags:hitchhiking,hitchwikigtags: Geographic coordinates and geohashL/ltags: Open Location Code (plus codes)
- Kind: 34242 (custom event type for geographic data)
- Content: Formatted as "hitchmap.com Author: Description #hitchhiking"
- Tags:
dtag: Database record ID for duplicate checkinggtags: Geographic coordinates and geohashL/ltags: Open Location Code with multiple precision levelsttags:hitchmap,map-notes
- Hitchwiki: Recent changes from RSS feeds (17 languages)
- Hitchmap: Geographic hitchhiking data from SQLite database
- Tags:
#hitchhiking,#hitchwiki,#hitchmap, geo coordinates
# Local
./nostrhitch-daemon -once # Run once
./nostrhitch-daemon -debug # Debug mode
./nostrhitch-daemon -dry-run # Test mode
# Docker
docker-compose up -d # Start daemon
docker-compose down # Stop daemon
docker-compose restart # Reload config
docker-compose logs -f # View logsnostrhitch/
├── main.go # Main daemon
├── config.json # Configuration
├── docker-compose.yml # Docker setup
├── hitchmap-dumps/ # SQLite databases (persistent)
└── logs/ # Log files