Automatically send your starred Pocket Casts episodes to Snipcast.io for AI-powered summarization via AWS Lambda.
This AWS Lambda function:
- Authenticates with Pocket Casts and retrieves unplayed starred episodes
- Sends episode URLs to Snipcast API for summarization
- Automatically removes stars and archives processed episodes
- Returns detailed results including success/failure counts
- Python 3.12+
- AWS account with appropriate permissions
- Terraform installed (for deployment)
- Pocket Casts account
- Snipcast.io account with API key
- Clone and setup:
git clone https://github.com/essoen/pocketcast-to-snipcast
cd pocketcast-to-snipcast
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt- Configure environment:
cp .env.example .env
# Edit .env with your credentials- Test locally:
source venv/bin/activate
python lambda_function.pySee detailed instructions in CLAUDE.md.
Quick start:
cd terraform
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your credentials
terraform init
terraform plan
terraform apply- Lambda Function (
lambda_function.py) - Main entry point and processing logic - Pocket Casts Client (
pocketcasts_client.py) - Custom API client - Terraform Infrastructure (
terraform/) - AWS deployment configuration
- EventBridge triggers Lambda on schedule (default: every 2 hours)
- Lambda authenticates with Pocket Casts
- Fetches starred episodes, filters for unplayed (playingStatus == 1)
- For each episode:
- Constructs share URL:
https://pca.st/episode/{episode_uuid} - Posts to Snipcast API
- If successful: unstars and archives episode
- Constructs share URL:
- Returns JSON summary with counts and episode details
pocketcast-to-snipcast/
├── lambda_function.py # Main Lambda handler
├── pocketcasts_client.py # Pocket Casts API client
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── terraform/ # Infrastructure as Code
│ ├── main.tf
│ ├── variables.tf
│ ├── outputs.tf
│ └── terraform.tfvars.example
├── lambda-deployment/ # Deployment package (auto-generated)
├── CLAUDE.md # Detailed architecture guide
└── README.md # This file
Required:
POCKET_CASTS_EMAIL: Pocket Casts account emailPOCKET_CASTS_PASSWORD: Pocket Casts account passwordSNIPCAST_API_KEY: Snipcast.io API key
Edit terraform/terraform.tfvars:
schedule_expression = "rate(1 hour)" # or "cron(0 12 * * ? *)"
schedule_rate = "1 hour"Then: terraform apply
- Verify credentials in
terraform.tfvars - Ensure using email/password (not third-party auth)
- Install dependencies:
cd lambda-deployment && pip install -r ../requirements.txt -t . - Redeploy:
terraform apply
- Check CloudWatch logs for unstar/archive operation status
- Lambda uses Pocket Casts playing status to avoid reprocessing
# Real-time logs
aws logs tail /aws/lambda/pocketcast-to-snipcast --region eu-north-1 --follow
# Get CloudWatch URL
terraform output cloudwatch_logs_urlaws lambda invoke \
--function-name pocketcast-to-snipcast \
--region eu-north-1 \
response.json
cat response.json | jq- All credentials passed as environment variables
- Terraform variables marked as
sensitive = true - Never commit
terraform.tfstateorterraform.tfvars - IAM role follows principle of least privilege
MIT License