Skip to content

windy-civi-pipelines/windy-civi-bluesky-bots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Windy Civi: Legislative BlueSky Bots

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.

Python 3.12+ License: MIT


๐ŸŽฏ The Problem We're Solving

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.

The Pivot

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.


๐Ÿ—๏ธ Architecture Overview

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):

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.)     โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽญ Use Cases

Advocacy Organizations

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."

Elected Officials

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..."

Researchers & Journalists

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

โœจ Key Features (Planned)

Phase 1: Basic Bot (MVP) ๐Ÿšง

  • Connect to BlueSky API
  • Post bill updates on schedule
  • Simple keyword matching (topics โ†’ bills)
  • Single account support

Phase 2: Multi-Org Platform ๐Ÿ“‹

  • Organization signup/login
  • Configure topics, keywords, bill sponsors
  • Multi-platform support (BlueSky + Twitter/X)
  • Post approval workflow (draft โ†’ review โ†’ publish)

Phase 3: Intelligence Layer ๐Ÿ”ฎ

  • 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)

Phase 4: Analytics & Engagement ๐Ÿ“Š

  • Post performance tracking
  • Engagement analytics
  • Optimal posting time suggestions
  • A/B testing for post formats

๐Ÿ› ๏ธ Technical Stack

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?)


๐Ÿš€ Getting Started

Prerequisites

  • Python 3.12+
  • BlueSky account with API credentials
  • Access to a Windy Civi data pipeline repo (e.g., usa-data-pipeline)

Installation

# 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

Configuration

# 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"]

Running the Bot

# 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-run

๐Ÿ“ Project Structure (Planned)

windy-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

๐Ÿงช Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=bot

# Test specific module
pytest tests/test_matcher.py

๐Ÿค Contributing

This is part of the Windy Civi ecosystem. Contributions welcome!

Getting involved:

  1. Check out the main pipeline repo
  2. Review open issues
  3. Submit PRs or feature requests

Development philosophy:

  • Start simple, iterate quickly
  • Meet users where they are
  • Open source, transparent, durable

๐Ÿ”— Related Projects


๐Ÿ“œ License

MIT License - Use freely, contribute openly.


๐Ÿ“ซ Contact


Meet people where they are. Make legislative transparency automatic. ๐Ÿ›๏ธโœจ

Part of the Windy Civi ecosystem.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published