Automated social media bots that turn legislative data into actionable content
This repository contains the bot infrastructure that powers automated BlueSky posts for civic organizations, advocacy groups, and elected officials tracking U.S. legislative activity.
People don't check legislative websites. Even engaged citizens don't have time to monitor bills, votes, and hearings across 50 states.
But people do check social media. They follow organizations they trust - advocacy groups, elected officials, journalists.
The solution: Bring legislative transparency to where people already are. Instead of building another civic app that sits unused, we're integrating legislative data into the feeds people already follow.
We built a civic engagement app first - and nobody used it. The lesson: meet people where they already are. This is that lesson in action.
This repository is the bot/engagement layer for the Windy Civi ecosystem. It consumes data from the Windy Civi data pipeline and publishes to social media.
Data Source (Pipeline):
- ๐๏ธ opencivicdata-blockchain-transformer - Main pipeline infrastructure
- ๐ State pipeline repos - USA, IL, TN, TX, etc.
- โ Provides: Clean, structured legislative data with incremental updates
This Repository (Bot Engine):
- ๐ค Monitors new bills/actions from pipeline repos
- ๐ฏ Matches legislation to organization topics/keywords
- โ๏ธ Generates social media posts
- ๐ฑ Publishes to BlueSky (and other platforms)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Data Pipeline (External Repos) โ
โ โ
โ github.com/windy-civi-pipelines/ โ
โ โโโ usa-data-pipeline/ โ
โ โโโ il-data-pipeline/ โ
โ โโโ ... โ
โ โ
โ โข Clean, versioned legislative data โ
โ โข Nightly updates โ
โ โข Full text extraction โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ (read data)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ THIS REPO: Bot Engine โ
โ โ
โ โข Monitor new bills/actions โ
โ โข Match to org topics โ
โ โข Generate posts โ
โ โข Schedule publishing โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ (publish)
โผ
โโโโโโโโโโโโโโโโโโ
โ BlueSky โ
โ (Twitter/X) โ
โ (etc.) โ
โโโโโโโโโโโโโโโโโโ
Black Lives Matter
- Auto-post when bills about criminal justice reform, police accountability, or voting rights are introduced
- Example: "๐จ New bill in Illinois: HB1234 would require body cameras on all police officers. Status: Committee hearing scheduled for Jan 15."
LGBTQIA+ Groups
- Track legislation affecting LGBTQ+ rights, healthcare access, discrimination protections
- Example: "
โ ๏ธ Texas SB567 moves to Senate floor: Would restrict gender-affirming care for minors. Call your senator."
Environmental Orgs
- Monitor climate policy, renewable energy funding, conservation bills
- Example: "๐ฑ Victory: California AB890 passes House - $2B for solar infrastructure. Senate vote next week."
State Senators & Representatives
- Auto-post when they sponsor, co-sponsor, or vote on legislation
- Example: "Today I voted YES on HB234 - expanding Medicaid to cover vision and dental care for 50,000 Illinois residents."
U.S. Congress Members
- Share federal legislation with constituent-friendly summaries
- Example: "I'm co-sponsoring HR1010, the Clean Water Act Reauthorization. This bill would..."
Policy Think Tanks
- Track legislation in specific domains (education, healthcare, housing)
- Auto-generate analysis threads when major bills are introduced
News Outlets
- Get alerts on high-impact bills before they become mainstream news
- Automatically post bill status updates to news account feeds
- Connect to BlueSky API
- Post bill updates on schedule
- Simple keyword matching (topics โ bills)
- Single account support
- Organization signup/login
- Configure topics, keywords, bill sponsors
- Multi-platform support (BlueSky + Twitter/X)
- Post approval workflow (draft โ review โ publish)
- AI-powered bill summarization
- Topic classification (auto-tag bills)
- Impact analysis ("who's affected, how")
- Suggested post text generation
- Sentiment-aware language (urgent vs. celebratory)
- Post performance tracking
- Engagement analytics
- Optimal posting time suggestions
- A/B testing for post formats
Language: Python 3.12+ Frameworks: (TBD - FastAPI for API? Celery for scheduled tasks?) BlueSky SDK: atproto (Python client) Data Source: Windy Civi Pipeline Repos Deployment: (TBD - GitHub Actions? Cloud Functions? Railway?)
- Python 3.12+
- BlueSky account with API credentials
- Access to a Windy Civi data pipeline repo (e.g., usa-data-pipeline)
# Clone the repository
git clone https://github.com/YOUR-ORG/windy-civi-bluesky-bots.git
cd windy-civi-bluesky-bots
# Install dependencies
pip install -r requirements.txt
# or
pipenv install
# Set up environment variables
cp .env.example .env
# Edit .env with your BlueSky credentials# config.yml example
bot:
name: "IL Climate Action Bot"
bluesky_handle: "@ilclimate.bsky.social"
topics:
- keywords: ["climate", "renewable energy", "carbon emissions"]
- bill_sponsors: ["Rep. Smith", "Sen. Johnson"]
posting:
frequency: "daily" # or "realtime"
time: "09:00 CT"
max_posts_per_day: 5
data_source:
pipeline_repo: "windy-civi-pipelines/il-data-pipeline"
watch_sessions: ["103", "104"]# Run once (manual)
python bot.py --config config.yml
# Run as scheduled service
python bot.py --config config.yml --daemon
# Dry run (preview posts without publishing)
python bot.py --config config.yml --dry-runwindy-civi-bluesky-bots/
โโโ bot/
โ โโโ __init__.py
โ โโโ bluesky_client.py # BlueSky API wrapper
โ โโโ data_fetcher.py # Pull from pipeline repos
โ โโโ matcher.py # Match bills to topics
โ โโโ post_generator.py # Generate post text
โ โโโ scheduler.py # Handle posting schedule
โโโ config/
โ โโโ config.schema.json # Config validation
โ โโโ example_config.yml # Example configuration
โโโ tests/
โ โโโ test_matcher.py
โ โโโ test_post_generator.py
โโโ .env.example
โโโ requirements.txt
โโโ README.md
โโโ bot.py # Main entry point
# Run all tests
pytest
# Run with coverage
pytest --cov=bot
# Test specific module
pytest tests/test_matcher.pyThis is part of the Windy Civi ecosystem. Contributions welcome!
Getting involved:
- Check out the main pipeline repo
- Review open issues
- Submit PRs or feature requests
Development philosophy:
- Start simple, iterate quickly
- Meet users where they are
- Open source, transparent, durable
- OpenCivicData Blockchain Transformer - Main data pipeline
- USA Data Pipeline - Federal legislative data
- State Pipelines - All 50 states (expanding)
MIT License - Use freely, contribute openly.
- Main Project: Windy Civi
- Website: windycivi.com
- Organization: Chicago-based civic tech initiative
Meet people where they are. Make legislative transparency automatic. ๐๏ธโจ
Part of the Windy Civi ecosystem.