Logo Lanfrica

egoodluck/nigeria2027electionsentiment

Domain:

natural language processing

Record type:

software
Creator:
ego
Host:
A live dashboard the showcases the sentiment scores of key contenders in Nigeria's 2027 election # Nigeria 2027 Election — YouTube Sentiment Collection Pipeline Collects YouTube comments mentioning Tinubu (APC), Atiku (ADC), and Peter Obi (NDC) from a fixed roster of 50 channels spanning major broadcast networks, investigative/digital outlets, print-backed digital channels, radio/talk shows, vernacular & regional-language broadcasts, and civil-society/advocacy channels. Each comment is tagged by candidate/party and each channel by outlet category, and comments are scored for sentiment — built for the six months leading up to Nigeria's January 16, 2027 presidential election. ## Before you run anything **1. Verify the channel handles.** Several entries in `config.CHANNELS` are marked `# VERIFY` — I identified these channels by name during research but could not always confirm the exact `@handle` YouTube currently uses. Visit `youtube.com/ ` for each marked channel and correct it in `config.py` if it doesn't resolve to the right page. `resolve_channels.py` will raise a clear error (not fail silently) on any handle it can't find, so a wrong handle stops the pipeline immediately rather than quietly missing a channel. **2. Get a free YouTube Data API v3 key:** 1. Go to console.cloud.google.com 2. Create a project (or use an existing one) 3. Enable "YouTube Data API v3" under APIs & Services 4. Create credentials → API key 5. Copy `.env.example` to `.env`, or just export it: `export YOUTUBE_API_KEY=your_key_here` Default free quota is 10,000 units/day — see the quota math below. With 50 channels, a full discovery pass is rationed across multiple daily runs to stay inside that quota rather than completing in one run. **3. Install dependencies:** ```bash pip install -r requirements.txt ``` ## Running it ```bash python resolve_channels.py # once, and again any time CHANNELS changes python run_pipeline.py # first collection run ``` For daily incremental collection over the six-month window, schedule `run_pipeline.py` via cron (adjust paths): ```cron 30 2 …