Skip to content

Latest commit

Β 

History

History
128 lines (89 loc) Β· 4.31 KB

File metadata and controls

128 lines (89 loc) Β· 4.31 KB

πŸ—³οΈ GitHub Comment Reactions Analyzer

A static web app that analyzes GitHub comment reactions and detects voting conflicts. Paste a GitHub comment link, and it will fetch all reactions, map each user to their assigned entity (country, company, team, etc.), and alert on conflicts.

No backend required β€” uses the public GitHub API and runs entirely in the browser.

Features

βœ… Parse GitHub Comments - Paste any GitHub issue comment link
βœ… Public API - No authentication required
βœ… Flexible Entity Mapping - Map users to countries, companies, teams, or any label
βœ… Flag Display - Automatically renders flag emojis for ISO country codes
βœ… Conflict Detection - Alerts when multiple users share the same entity
βœ… Unknown User Alerts - Warns when a reacting user is not in the voter list
βœ… Live Statistics - Thumbs up/down counts and duplicate totals
βœ… Color-Coded Display - Red rows for conflicts, yellow for unregistered users

Setup

1. Create your voter list

You can either upload a CSV file directly in the app, or create a local file.

Option A: Upload CSV via the Browser (Easiest)

  • When you open the app, if voting_data.csv is not found, an upload form will appear
  • Select your CSV file and click πŸ“€ Upload
  • The app will load the data and remember it for the session

Option B: Create a Local File

Copy the example file and fill in your participants:

cp voting_data.example.csv voting_data.csv

Edit voting_data.csv with your GitHub usernames and their assigned entity:

GitHub Name,Voting for
alice,CompanyA
bob,CompanyB
carol,CompanyA

Entities can be:

  • ISO country codes (SI, NL, DE, …) β†’ displayed with flag emoji automatically
  • Any text (company name, team, group) β†’ displayed as plain text

2. Serve locally

voting_data.csv is loaded via fetch(), so the page must be served over HTTP (not opened as file://).

Python 3:

python -m http.server 8000

Then open: http://localhost:8000/voting-validator.html

Node.js (via npx):

npx http-server

3. Deploy to GitHub Pages

Create a repository from this template-repository. You can configure default voting data creating a voting_data.csv file.

⚠️ voting_data.csv is in .gitignore by default to protect participant data.
Add it to your push only if the data is safe to make public.

Enable GitHub Pages in repository Settings β†’ Pages β†’ Deploy from main branch.

App will be live at: https://YOUR-USERNAME.github.io/YOUR-REPO/voting-validator.html

How to Use

  1. Get a GitHub Comment Link

    • Open any GitHub issue, scroll to a comment
    • Click the "..." menu on the comment β†’ "Copy link"
    • Example: https://github.com/owner/repo/issues/123#issuecomment-456789
  2. Paste & Analyze

    • Paste the link into the input field and click πŸ” Analyze
  3. Read the Results

    • βœ… Green Alert: No conflicts, all users registered
    • ⚠️ Yellow Alert: One or more reacting users are not in voting_data.csv
    • β›” Red Alert: Multiple users from the same entity reacted

File Structure

β”œβ”€β”€ voting-validator.html       # Main application (open in browser)
β”œβ”€β”€ voting_data.example.csv    # Template β€” copy to voting_data.csv and fill in
β”œβ”€β”€ voting_data.csv            # Your actual voter list (gitignored)
β”œβ”€β”€ .gitignore
└── README.md

Supported Country Flags

Any two-letter ISO 3166-1 alpha-2 code that maps to a flag emoji will render automatically. To add more, extend the COUNTRY_FLAGS object at the top of voting-validator.html.

API Notes

  • Rate Limit: 60 requests/hour per IP (unauthenticated public API)
  • Works with: Public repositories only
  • Reactions per request: Up to 100 (pagination not implemented)

Troubleshooting

CSV not loading / "no data" message

  • Open via http://localhost:8000 β€” not file:// directly
  • Verify voting_data.csv exists in the same directory as the HTML file
  • Check the browser console (F12) for fetch errors

No reactions found

  • Confirm the comment URL includes #issuecomment-XXXXXXXXX
  • Make sure the repository is public

Rate limit hit (403)

  • Wait an hour, or add a GitHub token to the request headers

Made with ❀️ for voting transparency