A complete automation solution for CBS Sports NFL Pickem pools that handles login, matchup extraction, pick generation, submission, and social preview creation.
- Automated Login: Handles CBS Sports authentication with cookie storage
- Matchup Extraction: Reads and saves all weekly NFL matchups with detailed stats
- Smart Predictions: Generates picks based on expert consensus and team preferences
- Automated Submission: Submits picks to CBS Sports automatically
- Social Previews: Creates shareable graphics of your weekly picks
- Scheduled Execution: Runs automatically every Thursday morning
- Native Notifications: Provides macOS notifications for workflow status
- GitHub Integration: Commits and pushes generated files to your repository
- Python 3.8 or higher
- macOS (for native notifications and launchd scheduling)
- Git (for repository operations)
- CBS Sports account with access to a Pickem pool
-
Clone the repository
git clone https://github.com/yourusername/cbs-pickem-automation.git cd cbs-pickem-automation
-
Create and activate a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Install Playwright browsers
playwright install
Create a .env
file in the project root with the following variables:
CBS_USERNAME=your_email@example.com
CBS_PASSWORD=your_password
CBS_POOL_URL=your_pool_url
CBS_USERNAME
: Your CBS Sports account emailCBS_PASSWORD
: Your CBS Sports account passwordCBS_POOL_URL
: The URL of your CBS Sports Pickem pool
-
Run the login script
python login.py
This will open a browser window where you can log in to CBS Sports. Complete any CAPTCHA or verification steps if required.
-
Verify authentication
python check_session.py
This will confirm if your login was successful and cookies were saved correctly.
Run the complete workflow manually:
phython run_local_workflow.py
This will:
- Check if your authentication is valid
- Extract this week's matchups
- Generate predictions
- Submit picks to CBS
- Create social preview images
- Commit and push changes to GitHub
The workflow is designed to run automatically every Thursday at 8:30 AM using macOS launchd.
-
Copy the launchd plist file
cp com.user.cbspickem.plist ~/Library/LaunchAgents/
-
Edit the plist file to match your paths
nano ~/Library/LaunchAgents/com.user.cbspickem.plist
Update the paths to match your repository location.
-
Load the launchd job
launchctl load ~/Library/LaunchAgents/com.user.cbspickem.plist
-
Verify the job is loaded
launchctl list | grep cbspickem
You can receive iOS notifications and save social preview images directly to your Photos app using iOS Shortcuts.
-
Install the iOS Shortcut
- Transfer the
iphone-shortcut/NFL Pickem's.shortcut
file to your iPhone - Open it to install the shortcut
- Grant necessary permissions when prompted
- Transfer the
-
Configure the Shortcut
- Open the Shortcuts app
- Edit the "NFL Pickem's" shortcut
- Update the GitHub repository URL if needed
- Ensure the "Save to Photos" action is enabled if you want images saved to your Photos app
-
Schedule the Shortcut
- Open the Shortcuts app
- Tap on the "Automation" tab at the bottom
- Tap the "+" button and select "Create Personal Automation"
- Select "Time of Day" and set it to 9:00 AM (or your preferred time)
- Select the days you want it to run (e.g., Thursdays)
- Tap "Next" and add an action to run your "NFL Pickem's" shortcut
- Disable "Ask Before Running" for true automation
- Tap "Done"
-
What the Shortcut Does
- Checks your GitHub repository for new social preview images
- Downloads the latest images
- Saves them to your Photos app
- Sends you an iOS notification with the preview
- Allows you to share your picks directly from the notification
CBS Sports uses cookies for authentication, which typically expire after 1-2 weeks.
- Cookie Storage: When you log in successfully, your session is saved to
cbs_storage.json
- Automatic Reuse: All scripts automatically use this file if it exists and is valid
- Security: The
cbs_storage.json
file is included in.gitignore
to prevent accidental commits
When your CBS Sports authentication expires:
- You'll receive a macOS notification indicating authentication failure
- To reauthenticate, simply run:
python login.py
- Complete the authentication process in the browser window
- Verify success with:
python check_session.py
The CBS Sports login process includes security measures that may require manual intervention:
- CAPTCHA/Verification: The login process may include CAPTCHA challenges or other verification steps
- Manual Steps: If automatic login fails, you'll need to complete verification steps manually
- Session Duration: CBS Sports sessions typically last 1-2 weeks before requiring reauthentication
-
Authentication Failures
- Run
python login.py
to create a new session - Check that your credentials in
.env
are correct
- Run
-
Script Errors
- Check
cbs_pickem_workflow.log
for detailed error information - Ensure your Python environment is activated:
source venv/bin/activate
- Check
-
Scheduled Job Not Running
- Verify the job is loaded:
launchctl list | grep cbspickem
- Check system logs:
log show --predicate 'processImagePath contains "cbspickem"' --last 1h
- Verify the job is loaded:
-
CBS Website Changes
- If CBS changes their website structure, scripts may need updating
- Check for updates to this repository or submit an issue
The workflow creates detailed logs:
cat cbs_pickem_workflow.log
- login.py: Handles authentication with CBS Sports and saves session cookies
- check_session.py: Verifies if your saved authentication is valid
- read_matchups.py: Extracts weekly matchups and saves to JSON
- predict_winners.py: Generates predictions based on expert consensus
- make_picks.py: Submits your picks to CBS Sports
- generate_social_previews.py: Creates shareable graphics of your picks
- run_local_workflow.py: Orchestrates the entire workflow
MIT