Skip to content

Setup Guide

Prerequisites

  • Python 3.11+
  • Reddit API credentials
  • OpenAI API key
  • Google Cloud service account

1. Clone Repository

bash
git clone https://github.com/your-username/reddit-crawler
cd reddit-crawler

2. Reddit API Setup

  1. Go to reddit.com/prefs/apps
  2. Click "Create App"
  3. Select "script"
  4. Note your client_id and client_secret

3. Google Sheets Setup

  1. Create a Google Cloud project
  2. Enable Google Sheets API
  3. Create a service account
  4. Download JSON key file
  5. Create a Google Sheet
  6. Share the sheet with the service account email (Editor access)

Service Account Email

The email looks like: name@project.iam.gserviceaccount.com

4. Environment Variables

bash
cp .env.example .env

Edit .env:

bash
# Reddit
REDDIT_CLIENT_ID=your_client_id
REDDIT_CLIENT_SECRET=your_client_secret
REDDIT_USER_AGENT=YourApp/1.0

# OpenAI
OPENAI_API_KEY=your_openai_key

# Google
GOOGLE_SERVICE_ACCOUNT_FILE=/app/credentials/service_account.json

5. Run

bash
# With Docker
docker-compose up -d

# Or directly
python -m app.main

6. Verify

Check your Google Sheet. New rows should appear after the first crawl.

Released under the MIT License.